API: Script: Appcache Handler
Clone this wiki locally
For the impatient: Go directly to How do I use the Appcache Handler? at the end of this page.
If you are unfamiliar with HTML5 offline application caching (Appcache), there are several excellent resources available online. For example, perhaps you might enjoy reading Dive Into HTML5: Let's Take This Offline.
If you need a tool to assist you in determining what your offline caching manifest should contain, perhaps you will find the Manifestr bookmarklet helpful.
If you need to have content available to users of your site even when they have no network connectivity, HTML5 offline application caching can do that.
In addition, you can use an Appcache to improve performance. This is especially useful with mobile devices that often have relatively slow and unreliable network connections.
Why do I need an Appcache Handler?
The MWF Device Telemetry Stack (DTS) complicates HTML5 offline application caching (Appcache). Fortunately, the MWF Appcache Handler makes it easy again.
Enter the Appcache Handler, which knows when to cache and when not to cache things.
How do I use the Appcache Handler?
Create your manifest as usual in
You can enable the Appcache on the appropriate page (usually
root/index.phpif you intend to cache the landing page for your MWF site) via the
add_appcache()method of the HTML Decorator:
If you are not using the MWF Decorator classes, you can specify the Appcache Handler in your
And that's it! Your content will only be placed in the HTML5 offline application cache when it is safe for the browser to do so.