1. Write the manifest File
Format:
Cache manifest // the file to be cached
#1.0.0.1 // version number. It is used to update the cache when the script is updated.
Ajaxflow.png
Bgimg.png
Blue_glass.png
Buttom.png
Copycodehighlight.gif
Docindex.png
Network: // note that a colon must be added to the resources listed in the network. The resources are obtained from the network regardless of whether the cache exists or not.
../JS/jquery-1.7.min.js
../JS/jquery. Corner. js
2. Specify the file <HTML manifest = "./examples/images/image. manifest"> On the HTML page.
3. Configure the server. Here I configure the Tomcat server. The specific steps are: Find the Web. xml file under the conf file of the service and add the following file.
<Mime-mapping>
<Extension> manifest </extension>
<Mime-type> text/cache-manifest </mime-type>
</Mime-mapping>
Note: You may not need to use the manifest file or another name. For example, PHP file, but If php file is used. Write the server configuration file like this
<Mime-mapping>
<Extension> php </extension>
<Mime-type> text/cache-php </mime-type>
</Mime-mapping>