Needed a place to dump AppCache use cases we (Facebook) felt the current Working Draft and Editor’s Draft didn’t address so I could reference them from the relevant entries in the HTML5 bug tracking system.
For references, these are:
- #14701 – appcache: remove the requirement for the MIME type
- #14702 – appcache: always up-to-date applications
- #14704 – appcache: allow a manifest to be identified by something other than its URL
- #14705 – appcache: SOP requirement for cache manifest files should be relaxed (at least) by CORS.
The following are use cases and are not intended as Contributions under the CLA.
Make a blog work offline
A blog engine (e.g. WordPress) can have a very basic offline mode that caches its index page and the _n_ entries listed on it for offline use. This wouldn’t modify its behavior when online, so that visiting the index page would always display the last entries and not need a page refresh to do so.
Allow an application hosted on a cluster of servers to be easily updated
An application is hosted on a cluster of servers behind a non-sticky load balancer. It is updated daily. Even though all servers are not updated instantly and two versions of the application co-exist for a while, it is possible to update the application without risking to have an out-of sync version of the application (e.g. manifest file and assets of the latest version combined with a Master Entry of the previous version) or to need to invalidate the cache to avoid such issues.
Defer or prevent the automatic update of an application
An ajax-heavy application, used largely in remote regions where connectivity is spotty, would be able to defer or prevent automatic update of AppCache so that it doesn’t interfere with the application’s own networking needs.
Prevent sensitive data from being cached
A website containing both public and sensitive HTML pages needs to be made available offline. The sensitive data must not be stored on the device. The website is hosted on a virtual host and HTTP headers cannot be modified. The web developer can prevent such pages from being cached by specifying them directly in the manifest.
Avoid polling the manifest file on each page load
An application used essentially while traveling abroad wants to reduce its number of requests to a minimum (so avoiding unnecessary calls to the manifest file every time it is loaded). However, it would still need to be patched immediately when an update is available. How the app becomes aware of the availability of an update could be through various means: a custom HTTP header or a cookie passed during an Ajax request, through a custom UI when the user is on Wifi, etc.
Programmatically busting the cache
While developing an offline application, a developer can easily bust the cache through the browser’s console.
Arguably, some of these use cases might be better handled at the OS level. It might be useful to hint at those through non-normative sections of the specification.