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

Source: Internet
Author: User
Tags ranges metabase

I did not successfully enable gzip in iis6 yesterday. Now I will try again. I will share with you the specific method of gzip compression. I hope it will be helpful to you.

Iis6 enable gzip compression. I will summarize the two main points.

1. In the website properties-service, the "compressed Application Files, compressed static files, and temporary directories are written
2. Add an iis Web Service Extension and load the C:/WINDOWS/system32/inetsrv/gzip. dll file.
3. Modify the C:/Windows/System32/inetsrv/MetaBase. xml file, which has two main parameters:

Set HcDoDynamicCompression to "TRUE" and add the dynamic file suffix to HcScriptFileExtensions.
HcDynamicCompressionLevel and HcOnDemandCompLevel indicate the required compression ratio. The value ranges from 0 to 10. The default value is 0.

This is probably the case. Let's take a look at the specific process.

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

First, we create a gzip folder (Folder name is random) in any location on any disk, right-click my computerManagement-services and applications-IIS-website-properties-services

Select the two options under http compression, and select the newly created gzip folder for the temporary directory.

In the Internet Information Service (IIS) manager, right-click "Web Service extension"-> "Add a new Web Service extension ...", In the new Web Service Extension box, enter the extension "HTTP Compression" and add the required file "C:/WINDOWS/system32/inetsrv/gzip. dll, the Windows System directory may vary depending on your installation, select "set extension status to allow ";

Open C:/Windows/System32/inetsrv/MetaBase. xml in a text editor (backup is recommended). stop IIS before editing MetaBase. xml. You can use net stop iisadmin

Locate Location = "/LM/W3SVC/Filters/Compression/gzip to set gzip Compression, locate Location ="/LM/W3SVC/Filters/Compression/deflate "to set deflate Compression. the above two nodes are next to each other. and set the same attributes.
To Compress dynamic files, set HcDoDynamicCompression to "TRUE" and add the dynamic file suffix, such as aspx, to HcScriptFileExtensions. If you need to compress static files, set HcDoStaticCompression and HcDoOnDemandCompression to "TRUE", and add the suffix of the static file to be compressed in HcFileExtensions, such as xml and css;

HcDynamicCompressionLevel and HcOnDemandCompLevel indicate the required compression ratio. The value ranges from 0 to 10. The default value is 0.

HcDynamicCompressionLevel attribute description: HcDynamicCompressionLevel Metabase Property
HcOnDemandCompLevel attribute description: HcOnDemandCompLevel Metabase Property

Note: These two attribute values are generally recommended to be set to 9, with the best cost effectiveness.

After saving, start iis admin and Enter cmd. Enter the net start iisadmin command.

At this point, the basic gzip settings have been completed, but do not forget that your IIS is not started at this time. In the same way, right-click my computer and choose Properties> services and applications> IIS> right-click all tasks> restart IIS.

Now GZIP is set up and the website service is started! See

The effect is still very obvious. Some people worry that gzip will be used for website indexing and seo. I think the effect is almost none.

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.