Portrait of Martijn

Making Pages Faster still

25 Jun 2011

The previous results were a good improvement in terms of webpagetest numbers, but the visual latency caused by the SSL in the delayed Twitter/Google Reader loads (for initial load and repeat loads) annoyed me.

So now I'm pre-fetching those (in a If-Modified-Since friendly way), store them my own server, combine both into a single file, and load that with caching enabled. I've added a fallback for if the dynamic content on Greenhills is missing, and reworked the no-Javascript case so it's nicer.

According to the new results that has dropped the first pageload from 0.8/1.7/2.6 to 0.7/1.6/1.7, and repeat page loads from 0.1/0.3/1.5 to 0.1/0.3/0.4. That's more like it; switching pages is really fast now. But the render flicker is noticeable, and the delayed Twitter/GoogleReader loading flickers too.

So, next I switched to dynamic content loading in the DOM, combined with the HTML5 History API per Dive Into HTML5, and some jQuery animation. Now new content loads fast and smooth, old content stays undisturbed. Bookmarks and links work. This looks great in current Safari, Chrome and Firefox. IE9 does not have history API support yet.

Update: added a spinner if the ajax load takes >1 sec.