1. Allow the compression ISAPI to run

IIS 6's new security system prohibits ISAPI DLLs from running by default, so you need to tell IIS 6 that it's okay to let the compression ISAPI DLL run.

01. Open the IIS admin tool (inetmgr); drill into your server, and right-click on "Web Service Extensions".

02. Choose "Add a new web service extension". For the extension name, use whatever you want to identify it in the list (I used "HTTP Compression Extension").

03. You need to add a single required file, which is \Windows\System32\inetsrv\gzip.dll, the ISAPI responsible for doing gzip and deflate compression. 


04. Check the "Set extension status to allowed", then click OK. 


05. You should have a new web service extension in your list called "HTTP Compression" (or whatever you named it), and it should have a status of "Allowed".

 

2. Select compressible content

IIS 6's compression system only compresses a very limited set of content. You need to enable compression for the appropriate file extensions (specifically, .aspx files for your ASP.NET pages, and perhaps any static content you want compressed as well).

01.   You're going to edit the Metabase. To do this, you first need to shut down IIS.

02.   In the IIS admin tool, right click on your server name in the left panel, and choose All Tasks -> Restart IIS.

03.   On the restart dialog, choose "Stop internet services" and click OK. When IIS is shut down, you'll need to edit \Windows\System32\inetsrv\MetaBase.xml (make a backup first!).

04.   Search for "IIsCompressionScheme". There will be two XML elements, one for deflate and one for gzip. Both elements have properties called HcFileExtensions and HcScriptFileExtensions. These contain a space-delimited list of file extension for compressible content.

05.   At a bare minimum, you'll need to add “aspx”, “ascx” to the HcScriptFileExtensions list. Note that if the properties are left blank, then all content, regardless of file extension, will be compressed.

 

Note:

1.      Make sure that IIS process user account has required privileges on the compression temp folder.

2.      Do never try to compress image types (jpg, gif, png, tiff etc…)

 

Note2:

1. You don't have to do step 1, which manually installs gzip.dll ISAPI. In the metabase xml file you can see it's already been taken care of. 


2. You don't have to modify metabase xml file manually, just use adsutil in C:\Inetpub\AdminScripts\ directory. the following script will enable most common file extentions for gzip/deflate compression. 



cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcFileExtensions "htm" "html" "txt" "ppt" "xls" "xml" "pdf" "xslt" "doc" "xsl" "htc" "js" "css" 


cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcFileExtensions "htm" "html" "txt" "ppt" "xls" "xml" "pdf" "xslt" "doc" "xsl" "htc" "js" "css" 


cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx"


cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" 


IISreset.exe /restart




Posted by 떼르미
,


자바스크립트를 허용해주세요!
Please Enable JavaScript![ Enable JavaScript ]