Home > Web Front-end > H5 Tutorial > body text

html5 offlline cache usage example_html5 tutorial skills

WBOY
Release: 2016-05-16 15:49:23
Original
1730 people have browsed it

If you want to use this API, you must ensure that the server is configured with the corresponding mime type.

Take tomcat as an example. Open the Tomcat 6.0confweb.xml file and add the following content at the end of the file

Copy code
The code is as follows:


manifest
text/cache- manifest


Particularly note that the value of extension is manifest, so the suffix of the future configuration cache file must be the same as it.

Using cache must be in the following format

Copy the code
The code is as follows:




...

< ;/html>

cache.mainfest is a file configured on the server side

The format is as follows

Copy Code
The code is as follows:

CACHE MANIFEST
index.html
time.js
time.css
#fallback is mainly used Replace the file when offline,
# /pay/ ofline.html All requests under pay will be forwarded to ofline.htm when offline
FALLBACK:
server-time.js fallback-server-time .js
NETWORK:
*
# version 9

where version is the version label. When the version changes, the client will automatically update the cache.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template