Web pages enable gzip compression to improve browsing speed

Source: Internet
Author: User

Benefits of enabling GZIP compression

Its benefits are obvious, improving the speed of web browsing, whether it was previously said to streamline the code, compressing the picture is not as good as gzip enabled. The effect after gzip is enabled.

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 Metebase.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= "htmhtmltxt" HcOnDemandCompLevel= "10 "hcpriority=" 1 "hcscriptfileextensions=" Aspdllexe "></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= "htmhtmltxt" hcondemandcomplevel= "Ten" hcpriority= "1" hcscriptfileextensions= "Aspdllexe" ></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= "ten" hcfileextensions= "Htmlcssjshtmxmltxt" Hcondemandcomplevel= "hcpriority=" 1 "hcscriptfileextensions=" Phpdll "></IIsCompressionScheme>< IIsCompressionScheme location = "/lm/w3svc/filters/compression/deflate" hccompressiondll= "%windir%\system32\ Inetsrv\gzip.dll "hccreateflags=" 2 "hcdodynamiccompression=" true "hcdoondemandcompression=" true " hcdostaticcompression= "TRUE" hcdynamiccompressionlevel= "ten" hcfileextensions= "Htmlcssjshtmxmltxt" Hcondemandcomplevel= "hcpriority=" 1 "hcscriptfileextensions=" Phpdll "></IIsCompressionScheme>

After you modify it, stop the IIS Admin Service services 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.

Source: Lu Songsong Blog (/qq:13340454), welcome to share this article, reproduced please keep the source!

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.