IIS7.5 Open gzip compression while enabling gzip compression Js/css file Setup method [Bubuko.com]

Source: Internet
Author: User

IIS7.5 or IIS7.0 turn on gzip compression method: Open IIS, click on the right side of a Web site, in the features view of the "IIS" area, double-click "Compress
”,

Tick "Enable dynamic content Compression" and "Enable static content compression" respectively. This is the most common setting for gzip compression to complete.

The difference between static content compression and dynamic content compression
Static content Compression: Compressed static responses can be cached to disk for use by multiple requests without compromising CPU resource performance. For the next request
, you can retrieve the compressed file from disk, which improves performance because the CPU does not have to compress the files again.
Dynamic content Compression: Compressing dynamic application responses can affect CPU resources because IIS does not cache compressed versions of dynamic output. If enabled for dynamic response
Compression, the new compressed response is sent each time IIS receives a request for a resource that contains dynamic content. Because dynamic compression consumes a lot of
CPU time and memory resources, it should only be used on servers that meet the following criteria: The client's network connection is slow, but there is an extra CPU
Room
When IIS is enabled for dynamic and static content compression, the default only compression suffix is htm and HTML files, and for JS, CSS is not compressed. For JS, CSS files have no
There are compression effects that can be viewed through some online testing tools.
How to let gzip compression support JS, CSS file? Further setup is required.
Open C:\Windows\System32\inetsrv\config\applicationhost.config and find the following:

<httpcompressionDirectory= "%systemdrive%\inetpub\temp\iis Temporary compressed Files">    <Schemename= "gzip"DLL= "%windir%\system32\inetsrv\gzip.dll" />    <Dynamictypes>        <AddMimeType= "text/*"enabled= "true" />        <AddMimeType= "message/*"enabled= "true" />        <AddMimeType="*/*"enabled= "false" />    </Dynamictypes>    <Statictypes>        <AddMimeType= "text/*"enabled= "true" />        <AddMimeType= "message/*"enabled= "true" />        <AddMimeType= "Application/x-javascript"enabled= "true" />        <AddMimeType= "Application/atom+xml"enabled= "true" />        <AddMimeType= "Application/xaml+xml"enabled= "true" />        <AddMimeType="*/*"enabled= "false" />    </Statictypes></httpcompression>

Cut "<add mimetype=" Application/x-javascript "enabled=" true "/>" under Dynamictypes to "Statictypes". You can add the MIME nodes that you need according to your situation.

Original: http://bubuko.com/infodetail-377441.html

IIS7.5 Open gzip compression while enabling gzip compression Js/css file Setup method [Bubuko.com]

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.