Let's talk about iis6 enabling gzip to compress static and dynamic pages (js, jpg, css, html)

Source: Internet
Author: User
Tags metabase

IIS6 turn on gzip compression I summarize two key points

1. In the site properties-services to "Compress application files and compressed static files, and temporary directory to write the
2. Add an IIS Web service extension and then load the C:/windows/system32/inetsrv/gzip.dll file
3. Modify the C:/windows/system32/inetsrv/metabase.xml file, there are two main parameters

HcDoDynamicCompression set to "TRUE" and add the name of the dynamic file suffix you want to compress in HcScriptFileExtensions
HcDynamicCompressionLevel and HcOnDemandCompLevel indicate the desired compression rate, with a value of 0-10 and a default of 0.

I'll take a look at the specific process.

Let's take a look at how to enable gzip compression for IIS6 .

First, we create a gzip folder anywhere on any disk (folder name is random), My Computer right key Management-Service and Application-iis-Web site-Properties-Services

Check the two options below for HTTP compression, and select the Gzip folder that we have just set up in the temp directory.

In Internet Information Services (IIS) Manager, right-click "Web Service Extensions"-> "Add a new Web service extension ...", in the new Web service Extension box, enter the extension "HTTP Compression" and add "required files" as c:/ Windows/system32/inetsrv/gzip.dll, where the Windows system directory may vary depending on your installation, select "Set extension status to allow";

Using a text editor to open C:/windows/system32/inetsrv/metabase.xml (recommended for backup), you need to stop IIS before editing MetaBase.xml, and you can use net stop IISAdmin

Find location = "/lm/w3svc/filters/compression/gzip used to set gzip compression, find location ="/lm/w3svc/filters/compression/deflate " Used to set deflate compression. The top two nodes are next to each other. And the properties set are the same.
If you need to compress a dynamic file, set HcDoDynamicCompression to TRUE, and in hcscriptfileextensions, add the dynamic file suffix name, such as ASPX, that you want to compress, and if you need to compress the static file, Set HcDoStaticCompression and HcDoOnDemandCompression to "TRUE" and add the static file suffix names you want to compress in hcfileextensions, such as XML, CSS, and so on;

HcDynamicCompressionLevel and HcOnDemandCompLevel indicate the desired compression rate, with a value of 0-10 and a default of 0.

HcDynamicCompressionLevel attribute Description: HcDynamicCompressionLevel Metabase Property
HcOnDemandCompLevel attribute Description: HcOnDemandCompLevel Metabase Property

Description: These two property values are generally recommended to set to 9, with the best price/performance.

After saving start IIS Admin also enter cmd, input command net start IISAdmin

Basically gzip has been set up here, but don't forget that your IIS did not start at this time. Also on my Computer right key properties-service and apply ascending-iis-right-all Tasks-restart IIS.

So gzip set up and start Web service! Look at enabling gzip-enabled effect chart

The effect is still very obvious, some people worry about enabling gzip will be included in the site, SEO impact, I think the impact is almost no.

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.