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><HTMLManifest= "M.manifest"><Head><MetaCharSet= "Utf-8"><Metahttp-equiv= "X-ua-compatible"content= "Ie=edge,chrome=1" /><Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0">
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.
Second, the use of CSS Sprite, reduce the HTTP request.
Third, the compression JS code, only refers to the current page needs JS.
Iv. use asynchronous loading of images and content.
Five, turn on the server gzip compression.
Six, compression CSS.
Seven, compressed HTML code
After the above optimization, again using the Baidu Webmaster detection, scores have a great increase.
The above is the optimization of the current stage, the next optimization under the PHP function.
Remember the page optimization and use caching mechanism