New Feature: Lazy Loading of Embedded Tweets
We’ve been getting a lot of reports here at Lizard Central that LGF members were having crashing problems in the longer comment threads, and after a lot of head-scritching and puzzlement I finally narrowed down the cause to… the embedded tweets.
Twitter’s embedded tweets work like this; when you post the URL of a tweet in a comment, our code calls Twitter’s API and gets a special block of HTML code that includes the text of the tweet, the author’s info, and its creation time. This HTML code is what first appears in a comment; it’s the “un-rendered” version of the tweet.
All of which leads us to the new feature.
When a page of comments loads now, instead of going through all of them and rendering them, our code stops that automatic rendering and leaves the tweets in their initial “un-rendered” text-only state.
And to let you see the actual fully rendered tweet, a button (that looks like a recycling symbol) is added to our blue action bar beneath the tweet. Click it and the tweet will be rendered by Twitter’s code, which works fast enough when it’s only doing one at a time.
And there’s actually a big advantage to this new approach; long comment threads now finish loading a whole lot faster, and people with limited memory devices like phones and tablets should be able to participate in much longer threads than before.
If you’re using a desktop computer and don’t have any crashing issues with pages full of embedded tweets, you can set it to always show embedded tweets with the checkbox at the top right of the comments.