How to turn on gzip compression for a windows2003+iis6.0 server

Source: Internet
Author: User
Keywords iis

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Before I have written an article to tell the Linux Apache server or virtual host of WordPress open gzip compression, and open the actual effect of compression can also be seen through the article in the picture. However, although the Linux server is more recommended, and Windows Server platform is also thinking 2008 and 2012 popular, but the use of Windows2003 system + IIS6.0 server webmaster actually have a lot of, so how to open gzip compression in such environment, still be worth talking about.

The first step is to open the Internet Information Services (IIS) Manager, right-click the "Site"-"properties", go to the Services option, and then select "Compress application Files" and "Compress static files" in the large box in "HTTP Compression", and "temporary directory" and "temporary directory maximum Limit" Use the default value directly.

  

In the second step, or in Internet Information Services (IIS) Manager, right-click the Web Service Extensions option, select Add a new Web service extension, and in the new Web service Extension box, enter the extension "HTTP Compression", "Required files" Add the path for C:\WINDOWS\system32\inetsrv\gzip.dll, generally most Windows2003 server should be this path, if there is very special, please according to their own situation to choose the position of Gzip.dll, remember to " Set extended status to allow "Also tick, then click OK.

  

Step three, come to the critical step. To stop the IIS6.0 server, enter "cmd" in "Run", enter the command line, and then enter "net stop IISAdmin" to stop the IIS service and back up the C:\Windows\System32\inetsrv\ MetaBase.xml This file (should be backed up before modifying any of the server's configuration files, which is a prerequisite for personal webmaster), then open the file in Notepad and make changes to the settings.

There are two places to change, one is location = "/lm/w3svc/filters/compression/deflate", the other is location = "/lm/w3svc/filters/compression /gzip ", the two places can be modified to open gzip. Content changes in two places are exactly the same, so just say it again.

Set the hcdodynamiccompression to "TRUE", which is used to compress the dynamic files, but if you do not intend to compress the dynamic files, it is OK to keep the "FALSE" state. And HcScriptFileExtensions is the need to compress the dynamic file suffix, such as ASP, PHP, aspx and so on.

Set HcDoStaticCompression and HcDoOnDemandCompression to "TRUE", which is used to open compressed static files, and there is no reason not to open them. Add static file suffixes that need to be compressed in hcfileextensions, such as HTML, CSS, XML, and so on.

The HcDynamicCompressionLevel and HcOnDemandCompLevel properties, which represent the gzip compression rate, can be filled with a number between 0-10, the default is 0, and usually the recommended setting is 9, which is the most cost-effective choice. (The picture of PHP added to the static file inside, we ignore it, this is a long time ago configured, anyway, the site is static, PHP compression does not matter)

  

When you have finished modifying, open the IIS server, still on the command line, and enter the "iisreset" command. In this way, gzip compression opened, you can use webmaster Tools on their own page to check to see how the effect.

It should be noted that when you modify the MetaBase.xml file, you may be unable to save, you will be prompted to "file is in use, cannot be saved", to resolve this issue, open IIS, right-click Local computer-Properties, and in Internet Information Services, tick Allows you to edit the configuration database directly, and then you can successfully edit the MetaBase.xml file.

  

After the opening of the GZIP, the site will have a more obvious speed to improve, but also can save a lot of bandwidth and traffic, the resulting CPU resource consumption does not matter. There have been people worried about the search engine on gzip compression page crawling problem, the fact that there is no problem, as long as the user's browser can be normal access to the page, search engine crawling up no problem.

This article by the Nebula Blog original, the original address http://www.kaelli.com/64.html, reproduced please keep this information, thank you.

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.