Comment: If you want to use this API, you must ensure that the corresponding mime type is configured on the server side. Take Tomcat as an example for you to give a detailed introduction. Interested people should not miss it.
If you want to use this API, you must ensure that the corresponding mime type is configured on the server side.Take tomcat as an example. Open the Tomcat 6.0/conf/web.xml file and add the following content at the end of the file.
<mime-mapping>
<extension>manifest</extension>
<mime-type>text/cache-manifest</mime-type>
</mime-mapping>
Pay special attention that the value of extension is manifest, so the suffix of the cache file must be the same as it is in the future.
The following format is required to use cache
<!DOCTYPE html>
<html manifest="/cache.manifest">
<body>
...
</body>
</html>
cache.mainfest is a file configured on the server side
The format is as follows
CACHE MANIFEST
index.html
time.js
time.css
#fallback is mainly used to replace files when offline.
# /pay/ ofline.html All requests below pay will be forwarded to ofline.htm offline
FALLBACK:
server-time.js fallback-server-time.js
NETWORK:
*
# version 9
where version is the version tag. When the version changes, the client will automatically update the cache.