IIS enables gzip compression

Source: Internet
Author: User
Tags metabase

IIS enables gzip compression, which is an optimization means and method to improve website speed and reduce server load, after testing, the website enables gzip compression after 3 times times faster! And the configuration is quite simple, so the majority of webmasters use. This article details how to enable gzip compression in IIS while addressing some of the issues that you may encounter.

steps for IIS to enable gzip compression :

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, the temporary directory can create a new directory of their own (this directory must be writable), or do not change it, using the system default path:%windir%\iis Temporary Compressed Files. Then click on the "OK" button.


3. Add a Web service extension

1), Right click on "Web Server Extensions" and select "Add a new Web service extension"


2), in the pop-up window to write "extension" (the name casually does not matter), click the "Add" button, select the file: C:\windows\system32\inetsrv\gzip.dll, and then tick "set extension status to run", and finally click the "OK" button.


4. Restart IIS. (Simple how-to: Start-and-run input command: Iisreset/restart, then enter)

All right, after the setup, this IIS Web server enables gzip compression, which is valid for all sites under this IIS server, not just for a site.

Note the problem :

As set above, gzip compression is only valid for static content, but for dynamic content, the ASPX file is not in the compressed range. Because the default compressible file does not have this extension. And in the management interface you can not find a place to add extensions, this time only to modify its configuration file. Under the c:\windows\system32\inetsrv\ there is a MetaBase.xml file, you can open it with Notepad, find IIsCompressionScheme, there are three identical names of the segment, is Deflate,gzip, Parameters, the third paragraph does not need to control it, the first two paragraphs have the same parameters, in the two paragraphs of the parameters hcscriptfileextensions below all add a line 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 dynamic web pages such as ASPX, enabling Web caching is an effective and practical optimization method used by the webmaster, which is quite simple to operate, which can be referenced in this article: The Server Performance optimization policy enables Web caching.

problems you may encounter :

MetaBase.xml can not be saved after modification ?

Why can't I save the MetaBase.xml after I've modified it? This is due to the fact that the file is being used by IIS, which can be solved by the following two methods.

The first method:

Stop IIS, and then edit the MetaBase.xml file.

Simple Ways to stop IIS: Start-and-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), tick "Allow direct editing of configuration Database", click "OK" button.


This allows you to edit the MetaBase.xml file without stopping IIS.

The first method sometimes fails, and the need to stop the site for a while, will affect the operation of the site, so the relative first method is recommended to choose the second method is better.

IIS enables gzip compression

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.