logo

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:

  1. 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).
  2. 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):
    1. Files always come from ApplicationCache – even if you’re online
    2. The ApplicationCache only updates if the content of the manifest itself has changed
    3. The ApplicationCache doesn’t replace the existing cache – files may still be cached even if ApplicationCache is updated
    4. Never ever ever far-future cache the manifest
    5. Non-cached resources will not load on a cached page
    6. It’s tough to separate mobile and desktop resources when you only have one cached file.

Also good: the MDN article

Categories: Developer's Journal

DestinyQuest
DestinyQuest Infinite is the first in the QuestForge Games, a new line of gamebooks.


%d bloggers like this: