Programmer’s Journal: Doing basic HTML5 caching
We’re in the process of figuring out how to make DestinyQuest Infinite run offline, and one of the first steps to doing so is making caching work. HTML5 features something called AppCache that lets you download files and save them for later.
If you’re making an HTML5 web app, this page has a relatively short guide that you should read carefully (AppCache is fickle). Here are some other things to remember:
- If it doesn’t work on an iPad, try renaming the manifest to cache.manifest (this is probably not true on iOS >4 but there’s no documentation officially stating that).
- This vividly titled article called Application Cache is a D&uchebag lists a few other caveats. In short (1-6, there are 3 more on the page):
- Files always come from ApplicationCache – even if you’re online
- The ApplicationCache only updates if the content of the manifest itself has changed
- The ApplicationCache doesn’t replace the existing cache – files may still be cached even if ApplicationCache is updated
- Never ever ever far-future cache the manifest
- Non-cached resources will not load on a cached page
- It’s tough to separate mobile and desktop resources when you only have one cached file.
Also good: the MDN article
13
Nov
Posted:
November 13, 2013 Wednesday at 7:01 pm