Troubleshoot problems with IIS gzip not enabled _win server

Source: Internet
Author: User
Tags gzip download vps metabase

1, gzip download installation of a key to open gzip

Standalone host/vps One-click to open the Gzip method for IIS Http://www.jb51.net/article/30151.htm

2, after the successful installation, basically can be, under normal circumstances is the GZIP cache directory C:\windows\IIS Temporary compressedfiles directory, we recommend to put to D disk, and give everyone the permissions can be.

Restart IIS.


IIS Enable gzip compression causes Openflashchart to display problems and solutions

When using the Openflashchart control in. NET to display a chart, who would have thought that the chart was normal or not and that the server IIS enabled gzip compression?
Two sites with the same set of procedures, a site Openflashchart chart can be normal display, another site is displayed as "IOError Error #2032", and this problem only appears in IE6 browser, Firefox and IE7 can be normal display, what is the cause of it?
Baidu and Google some, only to find out the reason is the server using Gzip compression optimization site and No-cache, the solution is to add HTTP headers in the returned page, sample code as follows:

Copy Code code as follows:

Response.Clear ();
Response.CacheControl = "No-cache";
Use this sentence instead of the above sentence
Response.appendheader ("Cache-control", "No-cache, No-store, Must-revalidate, max-age=-1");
Response.Write (Chart. ToString ()); Output Openflashchat Stream
Response.End ();


The following is a detailed introduction, suitable for hand-configured gzip friends

I. HTTP Compression overview

HTTP compression is a way to transfer compressed text content between a Web server and a browser. HTTP compression uses a common compression algorithm such as gzip compression HTML, JavaScript, or CSS files. The biggest benefit of compression is that it reduces the amount of data transferred by the network, thereby increasing the access speed of the client browser. Of course, it will also add a little bit of server burden. Gzip is a more common kind of HTTP compression algorithm.
This article describes the HTTP compression method, using the Windows system settings, the advantage is high efficiency.

Two. HTTP Compression working principle

The Web server works with HTTP compression as follows:
After the Web server receives the HTTP request from the browser, check to see if the browser supports HTTP compression;
If the browser supports HTTP compression, the Web server checks the suffix name of the request file;
If the request file is a static file such as HTML or CSS, the Web server checks the compressed buffer directory to see if the requested file has the latest compressed file;
If the compressed file of the request file does not exist, the Web server returns the uncompressed request file to the browser and holds the compressed file of the request file in the compressed buffer directory;
If the latest compressed file of the request file already exists, it returns the compressed file of the request file directly;
If the request file is a dynamic file such as ASPX, the Web server dynamically compresses the content and returns to the browser, and the compressed content is not stored in the compressed cache directory.

Small series on the internet to find a lot of information, gzip search engine SEO will not have an impact, and Baidu also made it clear that gzip data can be resolved.
We use Webmaster Station tools to detect the effect of gzip after:

However, note that gzip generally only for text such as Html effect, but has been compressed pictures such as gif,jpg and so is not effective.
Download we're going to teach you step-by-step how to open the gzip of IIS
1. Open Internet Information Services (IIS) Manager, right-click Web site-Properties, and select Services. In the HTTP Compression box, select Compress application files and compress static files, and set the maximum limit for temporary directories and temporary directories as needed;

2. In Internet Information Services (IIS) Manager, right-click "Web Service Extensions"-"Add a new Web service extension ...", enter the extension "HTTP Compression" in the new Web service Extension box, 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";

3. Use a text editor to open C:\Windows\System32\inetsrv\MetaBase.xml (recommended to back up first),
Please note before opening:
1. You need to stop IIS before editing MetaBase.xml, you can use Microsoft key +r to run: net stop IISAdmin
2. Reboot the VPS After the modification is complete

Find location = "/lm/w3svc/filters/compression/gzip used to set gzip compression,
Find location = "/lm/w3svc/filters/compression/deflate" 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;
If you need to compress a static file, set HcDoStaticCompression and HcDoOnDemandCompression to "TRUE".
And in hcfileextensions to add you need to compress the static file suffix name, such as XML, CSS, etc.;
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.

The key configuration is here: The following configuration is not mentioned, which causes gzip to not be effective.

hcnocompressionforhttp10= "TRUE"
Hcnocompressionforproxies= "TRUE"
To
hcnocompressionforhttp10= "FALSE"
Hcnocompressionforproxies= "FALSE"

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.