IIS enable gzip compression, is to improve the speed of the Web site and reduce server load an optimization means and methods, after testing, the site enables gzip compression, faster than 3 times times! And configuration is quite simple, so the vast number of Web site administrators use. This article details how to enable gzip compression in IIS, while addressing some of the issues that you might encounter.
to enable gzip compression for IIS :
1, open IIS, right click on "website", select "Properties"
2, in the open window, switch to the "Services" tab, and then select "HTTP Compression" under the two options, temporary directory can create a new directory of their own (this directory must be writable), you can not change it, use the system default path:%windir%\iis Temporary Compressed Files. Then click the "OK" button.
3. Add a Web service extension
1, right click on "Web Server Extensions", select "Add a new Web service extension"
2, in the pop-up window to write "extension" (name casually indifferent), click the "Add" button, select File: C:\windows\system32\inetsrv\gzip.dll, and then the check "set the extended state to run", and finally click "OK" button.
4, restart IIS. (Simple method of operation: Start-> run-> input command: Iisreset/restart, then enter)
OK, after setting up, this IIS Web server enables the gzip compression feature, which is valid for all sites under this IIS server, not just for a Web site.
Note the problem :
After setting, gzip compression is actually only valid for static content, and for dynamic content, ASPX files are not in the compression range. Because the default compressible file does not have this extension. In the admin interface you can't find a place to add an extension, and you can only modify its configuration file. Under C:\windows\system32\inetsrv\ There is a MetaBase.xml file, you can open it with Notepad, find the IIsCompressionScheme, there are three sections of the same name, respectively, Deflate,gzip, Parameters, the third paragraph does not care about it, the first two paragraphs have the basic same parameters, in these two paragraphs of the parameters hcscriptfileextensions under a row of ASPX, if you have other dynamic program to compress, also add here. HcDynamicCompressionLevel changed to 9, (0-10,9 is the most cost-effective one).
For ASPX and other dynamic Web pages, enable Web caching, is the vast number of webmaster use of effective and practical optimization method, the operation is quite simple, can refer to this article operation: Server performance Optimization policy to enable Web caching.
problems that you may encounter :
MetaBase.xml cannot be saved after modification ?
Why can't I save the MetaBase.xml after modifying it? This is due to the fact that the file is being used by IIS, and there are two ways to resolve this problem.
The first method:
Stop IIS, and then edit the MetaBase.xml file.
Simple way to stop IIS: Start-> run-> input command: iisreset/stop, then enter.
The second method:
Enable the "Allow direct editing of the Metabase" feature in IIS.
1), open IIS Manager, right-click Local computer-select Properties
2), check "Allow direct edit configuration Database", click "OK" button.
This allows you to edit the MetaBase.xml file without stopping IIS.
The first method is sometimes invalid, and need to stop the site for a while, will affect the operation of the site, so the first method is still recommended to choose the second method is better.