Thoughts on using HTML5 app manifest to speed up stuff
There is a well-known joke regarding the use of regular expressions:
Some people, when confronted with a problem, think
“I know, I'll use regular expressions.” Now they have two problems.
I'm starting to think my time playing with app manifests in webpages might've been better spent coming up a new version of that joke.
That little software snack uses a PHP file as the cache manifest with a simple script that looks for the most recent timestamp among files in that directory and prints it as as version # at the bottom of the file. The reasons for this are better explained by reading the documentation on how the HTML5 cache manifest works but it turned out to work really well — I have a completely functional, offline web-app that can automatically update itself when I change the , the icon or the sound byte.
That leads to our bad example: If you're running a WordPress plug don't just add a willy-nilly cache manifest file to your theme. Between the CDN and other externally loaded content it was a complete mess. I'm not sure if all browsers do this but Chrome seemed to really choke on files loaded from other URLs.
How can you use this on your blog? Well, this idea came to me late and I've implemented very roughly, but the pages across the main navigation for this site are all preloaded via the manifest file when you arrive. That means jumping over to about, contact or projects should load basically all of the content from cache even if it's the first time you're visiting the page.
The trade-off here is that the first time someone visits your page they'll be met with a slightly longer load time as those pages are pre-fetched... However it's only prefetching the HTML for those pages so it's not a noticeable difference. What is noticeable is the relative zippiness it gives your site as you move from page to page.
The next step would be to expand the cache file to automatically preload all of the blog posts you see in the "Recent Posts" sidebar.
Hmm. I'll come back to this whole idea with less tired eyes and try to do some actual, measured tests. In my initial testing it looks like this idea... might be working in Chrome.