First, using the HTML5 caching mechanism
1. First Rule code: m.manifest
Cache manifest# 2015-04-24 14:20# directly cached files Cache:/templates/specialty/css/style.css/templates/specialty/js/jquery.js /templates/specialty/js/index.js/templates/specialty/js/custom.js/templates/specialty/js/97zzw.jsnetwork:*
Cache: Files that need to be cached
Network: Files that need to be loaded from the Web
Of course there are other parameters, but I only test these; note: It is not cached if it is changed frequently, and if the cache can be modified by modifying the manifest file, let the browser recreate the cache.
2. Add a rule file to
<! DOCTYPE html>
3.manifest files need to be configured with the correct mime-type, i.e. "text/cache-manifest". Must be configured on the Web server.
If you are using Apache, you can add it in. htaccess:
AddType text/cache-manifest Manifest
The above 3 steps are completed, then you can test the
Under Chrome:
Cache success! Continue testing ———— >
Status code 304, using caching.
Under Firefox:
Summary: When defining rules, be aware that you want to cache data that is not always updated, do not miss the network rules, and there is a noticeable increase in speed.
Manifest save for self