How to enable Gzip in IIS

Source: Internet
Author: User

Enabling gzip balances the server bandwidth and performance. gzip compresses the file to save a lot of bandwidth, but it also increases the server processing load, this can be balanced by yourself.

 

First, describe the server environment: Windows2003 + IIS + PHP + ISAPI Rewrite. Check that the iis configuration content is correct, but the Gzip status is not enabled when querying the HTTP status, today, when I access a Discuz forum On the server, the bottom line is Gzip On. Is Gzip in PHP conflict with IIS? Run the test, open the PHP configuration file, disable the extension of php_zip.dll, and restart IIS.

After the preceding operations are completed, the Gzip status is enabled. There was no problem with the batch file opened by Gzip. The problem was that Gzip was also enabled in PHP, And the IIS was in conflict.

Enable gzip

Execute the following command through the command line to enable the compression of dynamic/static content:

Appcmd set config/section: urlCompression/doDynamicCompression: Trueappcmd set config/section: urlCompression/doStaticCompression: True: Add a new Web Service Extension (if not) and enter gzip. the full path of the dll.

Compressing additional file extensions on IIS 6.0
Modify HcFileExtensions In the MetaBase. xml file to add an additional file extension.

Compressing additional file extensions on IIS 7.0
Modify the ApplicationHost. config file, add the appropriate mimeType, and specify activation. open the file by referring to the original line. It may have to be set multiple times before it will succeed.

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.