Web pages enable gzip compression to improve browsing speed

Source: Internet
Author: User
Tags metabase

Gzip compression efficiency is very high, usually can achieve 70% compression ratio, that is, if your Web page has 30K, compression after the turn into 9K or so.
First step: Open IIS, enable HTTP compression service

Right-click Site, properties, and select Services. Select "Compress application Files" and "Compress static files" in the "HTTP Compression" box, set "Temp directory" and "Maximum limit of temporary directory" as required;
Step two: Enable Web services

Step Three: Modify MetaBase.xml
Start > Run input c:\windows\system32\inetsrv, find MetaBase.xml, first back up, in modify. (Some servers do not need to modify this file to be used)
Search location = "/lm/w3svc/filters/compression/gzip"
Carefully check the code:

<iiscompressionscheme location = "/lm/w3svc/filters/compression/deflate"Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"HcCreateFlags= "0"HcDoDynamicCompression= "TRUE"HcDoOnDemandCompression= "TRUE"HcDoStaticCompression= "FALSE"HcDynamicCompressionLevel= "0"hcfileextensions="htm HTML txt"HcOnDemandCompLevel= "10"hcpriority= "1"hcscriptfileextensions="ASP dll exe" > </IIsCompressionScheme> <iiscompressionscheme location = "/lm/w3svc/filters/compression/gzip"Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"HcCreateFlags= "1"HcDoDynamicCompression= "TRUE"HcDoOnDemandCompression= "TRUE"HcDoStaticCompression= "TRUE"HcDynamicCompressionLevel= "0"hcfileextensions="htm HTML txt"HcOnDemandCompLevel= "10"hcpriority= "1"hcscriptfileextensions="ASP dll exe" > </IIsCompressionScheme>

Replace with:

<iiscompressionscheme location = "/lm/w3svc/filters/compression/gzip"Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"HcCreateFlags= "1"HcDoDynamicCompression= "TRUE"HcDoOnDemandCompression= "TRUE"HcDoStaticCompression= "TRUE"HcDynamicCompressionLevel= "10"hcfileextensions="html css js htm XML txt"HcOnDemandCompLevel= "10"hcpriority= "1"hcscriptfileextensions="PHP DLL" > </IIsCompressionScheme> <iiscompressionscheme location = "/lm/w3svc/filters/compression/deflate"Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"HcCreateFlags= "2"HcDoDynamicCompression= "TRUE"HcDoOnDemandCompression= "TRUE"HcDoStaticCompression= "TRUE"HcDynamicCompressionLevel= "10"hcfileextensions="html css js htm XML txt"HcOnDemandCompLevel= "10"hcpriority= "1"hcscriptfileextensions="PHP DLL" > </IIsCompressionScheme>

After you modify it, stop the IIS Admin Services service in the service

Then, after saving the Metebase.xml, save it and start IIS again. This enables the GZIP compression to be enabled successfully.

Finally, test gzip compression is successful, you can go to Webmaster Tools http://tool.chinaz.com/Gzips/to detect.

Tips:

This article is only demonstrated on the Windows IIS server, VPS host, standalone server can be implemented, virtual host users need to consult the space quotient (General virtual host is enabled gzip) If your station has difficulty in enabling gzip compression, you can comment and communicate here, I will try my best to answer for you.

Web pages enable gzip compression to improve browsing speed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.