IIS enable gzip and pros and cons analysis _win server

Source: Internet
Author: User
Tags change settings static class metabase
Modern browsers IE6 and Firefox support the client gzip, that is, the Web page on the server, before transmission, the first use of gzip compression and then transmitted to the client, after the client received by the browser to extract the display, which takes up a little bit of server and client CPU, But in exchange for higher bandwidth utilization. For plain text, the compression rate is considerable. If each user saves 50% of the bandwidth, the amount of bandwidth you rent can serve one more customer.
IIS6 has built-in gzip compression support, unfortunately, there is no better management interface settings. So it's going to take some work to open this option.
First, if you need to compress the static file (HTML), you need to build a directory on your hard disk and give it the write permission to "IUSR_ machine name". If the compressed dynamic file (php,asp,aspx) does not need to, because its page is dynamically generated every time, after the compression is discarded. Then in IIS Manager, the right key to the Web site-Properties, not one of the following sites, but the entire Web site. Go to the Services tab, select Enable dynamic content compression, static content compression.
Then select the server extension below the Web site to create a new server extension. Name doesn't matter, the following path to the Add file is:
C:\windows\system32\inetsrv\gzip.dll, and then enable this extension.
Static content can be compressed at this time, but for dynamic content, the ASPX file is not in the compression range. Because the default compressible file does not have this extension. In the admin interface you can't find a place to add an extension, and you can only modify its configuration file.
Under C:\windows\system32\inetsrv\ There is a MetaBase.xml file, you can open it with Notepad, find the IIsCompressionScheme, there are three sections of the same name, respectively, Deflate,gzip, Parameters, the third paragraph does not care about it, the first two paragraphs have the basic same parameters, in these two paragraphs of the parameters hcscriptfileextensions under a row of ASPX, if you have other dynamic program to compress, also add here. HcDynamicCompressionLevel changed to 9, (0-10,9 is the most cost-effective one).


let the discuz speed rise again--"Turn on IIS gzip compression"

The following methods promoteDiscuz6.1 compression rate of 0.33%, although very small, but for some visitors over the site, will probably be a leap in speed (not tried, so ismay be)。 The reason for this is that the Disczu6.1 compression rate is increased by 0.33% because the following tests are performed under Discuz6.1 and other construction procedures apply (However, the percentage of Ascension is unknown, welcome to test)
Note: By increasing the compression rate, the user can improve the speed of browsing the website.

"The following is the actual data test result"
When no gzip is turned on:

Opened theDiscuz6.1Background gzip Compression:

Enable gzip compression in Windows2003 II6:

By comparing the data above, it seems that a 0.33% increase is not enough to explain anything. Personally feel that when a larger web site (prerequisite hardware content), open it will significantly increase the speed. (Speed up at the same time, is sacrificing system resources, so if the server configuration is not too good, need to adjust the relevant parameters)
The above data is derived fromhttp://www.pipeboost.com, enter the URL at this location after entering:

"How do I configure gzip compression in II6?" "
Note: The following tutorial, partly not given too much description,as long asAccording to the following configuration, general will not be a problem (because of their own in the configuration, very smooth, if there are problems, first of all, please check the steps 3 times, if all correct, still problems exist, please reply to inform)
If you are going to test or install, please read one word carefully!

Step One:
Open the II6 interface > select "website" > Right Key Properties > select "Services" > follow the image to tick
Where "the maximum capacity of the Temp directory" and "Temp directory”change settings on their own
Special attention is given to temporary directory user permissions (write, modify, read)

Step Two:
Select Web Service Extensions > Right margin on right "key new Web Service Extensions" > follow the diagram input related
"Set extended status to optional" tick
"Add files" most likely because everyone's server configuration is different, please search yourself (or follow the diagram to see if it exists)

Step Three:
Start > Run Enter c:\windows\system32\inetsrv (if error, please follow the figure) > Find MetaBase.xml
Copy one to the desktop (and change to Bak_metabase.xml) as a backup.

Step Four:
Open Metebase.xml > Search Location = "/lm/w3svc/filters/compression/gzip" with tools such as text


You will then see the following code (carefully check the next paragraph)
<iiscompressionscheme Location = "/lm/w3svc/filters/compression/deflate"
Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"
hccreateflags= "0"
hcdodynamiccompression= "TRUE"
hcdoondemandcompression= "TRUE"
hcdostaticcompression= "FALSE"
Hcdynamiccompressionlevel= "0"
hcfileextensions= "htm
Html
txt
Hcondemandcomplevel= "10"
hcpriority= "1"
hcscriptfileextensions= "ASP
Dll
Exe
>
</IIsCompressionScheme>
<iiscompressionscheme Location = "/lm/w3svc/filters/compression/gzip"
Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"
hccreateflags= "1"
hcdodynamiccompression= "TRUE"
hcdoondemandcompression= "TRUE"
hcdostaticcompression= "TRUE"
Hcdynamiccompressionlevel= "0"
hcfileextensions= "htm
Html
txt
Hcondemandcomplevel= "10"
hcpriority= "1"
hcscriptfileextensions= "ASP
Dll
Exe
>
</IIsCompressionScheme>
Replace with:
<iiscompressionscheme Location = "/lm/w3svc/filters/compression/gzip"
Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"
hccreateflags= "1"
hcdodynamiccompression= "TRUE"
hcdoondemandcompression= "TRUE"
hcdostaticcompression= "TRUE"
HcDynamicCompressionLevel= "10"
hcfileextensions= "html
Css
Js
Htm
Xml
txt
HcOnDemandCompLevel= "10"
hcpriority= "1"
hcscriptfileextensions= "PHP
Dll
>
</IIsCompressionScheme>
<iiscompressionscheme Location = "/lm/w3svc/filters/compression/deflate"
Hccompressiondll= "%windir%\system32\inetsrv\gzip.dll"
Hccreateflags= "2"
hcdodynamiccompression= "TRUE"
hcdoondemandcompression= "TRUE"
hcdostaticcompression= "TRUE"
Hcdynamiccompressionlevel= "10"
hcfileextensions="Html
Css
Js
Htm
Xml
txt
HcOnDemandCompLevel= "10"
hcpriority= "1"
hcscriptfileextensions= "Php
Dll
>
</IIsCompressionScheme>
RedPartly for you to compress theFile Type, please increase yourself.The above is a static class file, below is a dynamic class file.
The Blue part is the compression level , the value is 0-10, according to the server hardware and so on the environment to do the debugging (may start with the article first when mentions the URL, first tests and records "does not open any gzip value" and " Open Discuz6.1 Background gzip value ", and then configure to complete, and then record" open IIS6 under the gzip when the value ", 3 can be compared to the
then save to the desktop first, named Metebase.xml

Step Five:
My Computer > Control Panel > Management Tools > Services
Find IIS Admin Service > Stop

Step Six:
Go back to the directory where you found Metebase.xml, delete it

Step Seven:
At the end of step four, let everyone save to the desktop, and now we cut it.

Step Eight:
Go back to the place where you just deleted the metebase.xml and paste it in from the desktop.

Step Nine:
In step V, we stopped the IIS Admin service, and now we click to start it. (figure is the same as step five, so please take the actual)

Step Ten:
back to II6, restart IIS

Step 11:
Enter Discuz6.1 background, turn off Gzip compression (important)
If not shut down, compression effect will reduce 0.33% (not close, then is 2 gzip compressed, and output, will give priority to use Discuz6.1 backstage, so will drop, must close)

Step 12:
Update the Disucz6.1 cache, as shown in the figure tick

here, the configuration is complete! These tutorials may be verbose for some people, but they are more detailed for configuration reasons. In addition Disucz6.1 background of gzip compression equivalent to compression level 9, here we adjust to 10. In my personal sense, Discuz6.1 background-enabled gzip compression will have a more obvious click Pause, but it is likely to be a person feeling, interested friends can repeatedly test! Write 3 hours of tutorials, some places if insufficient or wrong, please point out, do not use uncivilized language:)

Cautiously open gzip acceleration may affect Baidu spider crawl

GZIP is the abbreviation of "GNU Zip" and is a compression method developed by jean-loupgailly. "Gzip acceleration" is the page sent by the server to the client before the use of gzip compression, and then to the client decompression operation, due to the volume of transmission data greatly reduced, the download speed of course to improve. But broadband is now widespread, and this technology does not lead to significant speed increases.
Because this function needs to decompress on the client, so need search engine spiders can be correct decompression to analyze the content of the Web page, if decompression failure, it will lead to search engine spider crawl failed, on this gzip problem I conducted a test.
This time my experiment uses 6 websites, the website is maintains the daily update, although is not original, but all is the artificial selective reproduction, and carries on the title modification. 3 of them are my own, all on the Portal Server (gzip enabled), one is the customer, put on his own server (opened gzip), there are two customers, placed in the purchase of the virtual host (not open gzip), after two months of collection analysis, began to include all normal, Every week to maintain growth, but in the Wednesday big update, opened the GZIP 4 sites, Baidu included all reduced by about 60%, did not open gzip two sites included a substantial growth, the Wednesday big update, opened the GZIP 4 sites, one included only the home page, The remaining three included a reduction of about 30 pages, not open gzip two sites are still significantly increased; This 6 sites are included in Google are very normal, there is no big fluctuations, are a smooth increase included.
Based on this test, the initial verification result is Google can perfect support gzip compression, Baidu support is not very good, I estimate may be because some of the server compression rate is too large may lead to the recognition of spiders failed, so the server log in a large number of 200 0 64 records, before we for 200 The 064 issue has been discussed for a long time and there is no final conclusion, and it now appears that the possibility of gzip is high.
At present, I have been placed in the portal to the Web site to the server does not open gzip, I will continue to observe, see whether the collection after the turn will be better.
The way to monitor whether the server turns on gzip is to select a Web site in the server with the "Gzip detection tool" check to find out. If your station also appears to include the symptoms of a sharp decline, it is recommended that you check to see if it also turned on the gzip compression function.

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.