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]