The advantage of gzip compression on Web pages is obvious. The first is to reduce the server bandwidth, and the second is to increase the speed at which users open the web page. Iwms has a built-in gzip compression function, but it is only valid for dynamic pages. If you have generated a static file and the server is IIS6 (Windows2003 or later), you can simply enable the gzip compression function provided by IIS through the content described below, experience the benefits of gzip compression.
The modern browsers IE6 and Firefox both support the client gzip. That is to say, before the webpage on the server is transmitted, Gzip compression is used before it is transmitted to the client. After receiving the webpage, the client is decompressed and displayed by the browser, in this way, although the CPU usage of some servers and clients is slightly occupied, the bandwidth utilization is higher. For plain text, the compression ratio is considerable. If each user saves 50% of the bandwidth, the bandwidth you lease will be able to serve customers more than doubled.
IIS6 has built-in support for gzip compression. Unfortunately, there is no better management interface. It takes some effort to enable this option.
First, if you need to compress static files (HTML), you need to create a directory on the hard disk and give it the write permission of the user "IUSR _ machine name. It is not required to compress dynamic files (PHP, ASP, and aspx), because the pages are dynamically generated every time, so you can discard them after compression. In the IIS manager, right-click the website and choose "properties". The website is not the following site, but the whole website. Go to the "service" tab and choose to enable dynamic content compression and static content compression.
Select the Server Extension under the website and create a new server extension. The name does not matter. The path of the file to be added below is:
C: \ windows \ system32 \ inetsrv \ gzip. dll and enable this extension.
Before modification, we need to modify a configuration file. Before modification, stop the IIS service and Open c: \ windows \ system32 \ inetsrv \ metabase. XML. The file is large. Find the following information:
<Iiscompressionschemelocation = "/lm/w3svc/filters/compression/gzip" hccompressiondll = "% WINDIR % \ system32 \ inetsrv \ gzip. DLL "compression =" 1 "hcdodynamiccompression =" true "compression =" true "hcdostaticcompression =" true "compression =" 0 "hcfileextensions =" htmhtmltxt "hcondemancomplevel =" 10 "hcpriority =" 1 "hcscriptfileextensions =" aspdllexe "> </iiscompressionscheme>
Add some file suffixes to be compressed. hcfileextensions is the extension of static files, and JS and CSS are added. hcscriptfileextensions is the extension of dynamic files, and aspx and hcdynamiccompressionlevel are added to 9, (0-10, 9 is the most cost-effective ).
Then you need to restart the IIS service to experience the compressed