How to enable GZip compression in IIS

Source: Internet
Author: User
Tags metabase

This article provides a detailed description of how to enable GZip compression in the IIS environment. For more information, see references.

IIS enables GZip compression, which is an optimization method and Method for Improving the website speed and reducing server load. After testing, after the website enables GZip compression, the speed is three times faster! The configuration is also quite simple, so it is used by the majority of website administrators. This article describes how to enable GZip compression in IIS and solve some possible problems.

To enable GZip compression in IIS:

1. Open IIS, right-click "website", and select "properties"

2. In the open window, switch to the "service" label and select two options under "HTTP compression". You can create a new directory for the temporary directory (this directory must be writable ), you can also use the default path % windir % IIS Temporary Compressed Files without modifying it. Click "OK.

3. Add a Web Service Extension

1) Right-click "Web Server Extension" and select "Add a new Web Service extension"

2) write the "extension" in the pop-up window (the name does not matter), click the "add" button, and select the file c: windowssystem32inetsrvgzip. dll, select "set extension status to run", and click "OK.

4. Restart IIS. (Simple operation method: Start-> Run-> enter the command: iisreset/restart, and press Enter)

After the preceding settings, the IIS Web server enables the GZip compression function. This function is effective for all websites under the IIS server, not just for a specific website.

Notes:

After the above settings, GZip compression is only valid for static content, but for dynamic content, the aspx file is not within the compression range. Because the default file that can be compressed does not have this extension. On the management interface, you cannot find a place where the extension can be added. At this time, you can only modify its configuration file. There is a MetaBase under c: windowssystem32inetsrv. xml file. You can open it in notepad and find the IIsCompressionScheme. There are three segments with the same name, namely deflate, gzip, and Parameters. You do not need to worry about the third segment, the first two paragraphs have basically the same parameters. Add a line of aspx under the parameters HcScriptFileExtensions. If you have other dynamic programs to compress, add them here. Change HcDynamicCompressionLevel to 9 (0-10, 9 is the most cost-effective ).

For dynamic web pages such as aspx, enabling web page caching is an effective and practical optimization method adopted by the majority of website administrators. The operation is also quite simple. Refer to this article for operations: enable Web cache based on the server performance optimization policy.

Possible problems:

MetaBase. xml cannot be saved after modification?

Why cannot I save the modified MetaBase. xml file? This is because the file is being used by IIS. You can solve this problem using the following two methods.

Method 1:

Stop IIS and edit the metabase. xml file.

To stop IIS, choose Start> RUN> enter the command iisreset/stop, and press Enter.

Method 2:

Enable "allow direct editing of configuration database" in IIS.

1) Open the iis manager, right-click the local computer, and select Properties.


2) Select "allow direct configuration database editing" and click "OK.

 

In this way, you can edit the metabase. xml file without stopping IIS.

The first method sometimes becomes invalid and the website needs to be stopped for a while, which will affect the website operation. Therefore, it is recommended that the second method be better than the first method.

Related Article

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.