Time for action – creating a cache manifest
Let's create a simple application from our template to demonstrate how to use the cache manifest. It has HTML, CSS, and JavaScript files, and a couple of images in an image
folder. You can find the source code for this example in Chapter 10/example10.2
.
Now let's create a cache manifest file named app.appcache
:
CACHE MANIFEST # v10.2.01
The manifest file must always begin with CACHE MANIFEST
on the first line. On the second line we have a comment. Lines that start with a hash mark (#
) are comments. It's recommended that you have some type of version identifier or the release date in the comments of your manifest file. As noted previously, the only way to cause your application to be reloaded into the cache is to change the manifest file. Each time you release a new version you will need to update this version identifier.
Next, we add the files that we want cached. You can add the CACHE
section header if you like, but it&apos...