In the previous recipe, we looked at how you can know if your mobile device is offline—let's take this a step forward by telling your browser how to cache content using a manifest, in the event it is unable to connect to the Internet.
For this recipe, all you will need is your normal text editor, as well as a working installation of a local web server, such as WAMP (for PC) or MAMP (for Macs). For the purposes of this recipe, I will assume you are using WAMP. You will also need a copy of the code that is available with this book; it contains some of the files required for this task.
Perform the following steps, to use a manifest for caching: