test.ical.ly | getting the web by the balls

Jul/11

18

If you can make your website static you can just as well prepare for mobile using the HTML5 offline application caching

I’ve been writing before about making websites static when possible as well as using client side databases. Static website are fast as there is no server side logic or database interaction. This also drastically minimizes the infrastructure necessary. You can even host your website on Dropbox!

But what if the user is browsing your website using a mobile device? He could go offline every now and then and your website would stop functioning.

Unless..

Unless your website could reside in the users browser.

Welcome to HTML5 offline application caching. By simply defining a cache manifesto you can specify which files the browser is supposed to cache for working offline (the Cache: directive), which not to cache (the Network: directive) and which files to fall back to (the Fallback: directive).

This should of course be combined with some sensible caching headers for the files on the server. This way the browser would cache anything specified for as long as possible so that the user would experience the best part of your website from the browser cache in amazing speed.

The manifesto would then make sure that the cached files are used even when the user is offline or your website is unreachable.

I’m not going to explain the exact working here as other already have done that here and here.

No tags



<<

>>

Theme Design by devolux.nh2.me