Chapter 6. Going Offline
The Basics of the Offline Application Cache
The main component of the offline application cache is a cache manifest file that you host on your web server. I’m going to use a simple example to explain the concepts involved, then I’ll show you how to apply what you’ve learned to the Kilo example we’ve been working on.
A manifest file is just a simple text document
that lives on your web server and is sent to the user’s device with a
content type of
cache-manifest. The manifest contains a list
of files a user’s device must download and save in order to function.
Consider a web directory containing the following files:
index.html logo.jpg scripts/demo.js styles/screen.css
In this case, index.html is the page users will load in their browsers when they visit the application. The other files are referenced from within index.html. To make everything available offline, you’d create a file named demo.manifest in the directory with index.html (don’t bother creating this just ...