Enable IIS HTTP conditional GET and HTTP compression

To enable HTTP compression and Conditional GET please follow these steps-

1. You need to open Metabase.xml from the location – C:\Windows\System32\inetsrv

******Please take much care in handling this since you are doing this in Metabase file. Any incorrect actions can lead to severe problems. Do it at your own risk******

**Before doing this please make sure your IIS Metabase is directly editable without stopping IIS. If this option is not enabled you can enable it in IIS > properties of server name > under ‘Internet Information Services’ tab > check ‘Enable Direct Metabase Edit’ check box > hit Ok. Otherwise you will have to stop IIS then open Metabase.xml to proceed further. Either things will work according to your convenience**

And look for the following parameters-

<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>
<IIsCompressionSchemes Location =”/LM/W3SVC/Filters/Compression/Parameters”
HcCacheControlHeader=”max-age=86400″
HcCompressionBufferSize=”8192″
HcCompressionDirectory=”%windir%\IIS Temporary Compressed Files”
HcDoDiskSpaceLimiting=”FALSE”
HcDoDynamicCompression=”FALSE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”FALSE”
HcExpiresHeader=”Wed, 01 Jan 1997 12:00:00 GMT”
HcFilesDeletedPerDiskFree=”256″
HcIoBufferSize=”8192″
HcMaxDiskSpaceUsage=”100000000″
HcMaxQueueLength=”1000″
HcMinFileSizeForComp=”1″
HcNoCompressionForHttp10=”TRUE”
HcNoCompressionForProxies=”TRUE”
HcNoCompressionForRange=”FALSE”
HcSendCacheHeaders=”FALSE”
>
</IIsCompressionSchemes>

Change the above to the following-

<IIsCompressionScheme Location =”/LM/W3SVC/Filters/Compression/deflate”
HcCompressionDll=”%windir%\system32\inetsrv\gzip.dll”
HcCreateFlags=”0″
HcDoDynamicCompression=”TRUE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”TRUE”
HcDynamicCompressionLevel=”10″
HcFileExtensions=”htm
xml
css
rdf
js
html
txt”
HcOnDemandCompLevel=”10″
HcPriority=”1″
HcScriptFileExtensions=”asp
php
cgi
dll
aspx
asmx
exe”
>
</IIsCompressionScheme>
<IIsCompressionScheme Location =”/LM/W3SVC/Filters/Compression/gzip”
HcCompressionDll=”%windir%\system32\inetsrv\gzip.dll”
HcCreateFlags=”1″
HcDoDynamicCompression=”TRUE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”TRUE”
HcDynamicCompressionLevel=”10″
HcFileExtensions=”htm
html
xml
css
rdf
js
txt”
HcOnDemandCompLevel=”10″
HcPriority=”1″
HcScriptFileExtensions=”asp
php
cgi
aspx
asmx
dll
exe”
>
</IIsCompressionScheme>
<IIsCompressionSchemes Location =”/LM/W3SVC/Filters/Compression/Parameters”
HcCacheControlHeader=”max-age=86400″
HcCompressionBufferSize=”8192″
HcCompressionDirectory=”%windir%\IIS Temporary Compressed Files”
HcDoDiskSpaceLimiting=”TRUE”
HcDoDynamicCompression=”FALSE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”FALSE”
HcExpiresHeader=”Wed, 01 Jan 1997 12:00:00 GMT”
HcFilesDeletedPerDiskFree=”256″
HcIoBufferSize=”8192″
HcMaxDiskSpaceUsage=”100000000″
HcMaxQueueLength=”1000″
HcMinFileSizeForComp=”1″
HcNoCompressionForHttp10=”FALSE”
HcNoCompressionForProxies=”FALSE”
HcNoCompressionForRange=”FALSE”
HcSendCacheHeaders=”FALSE”
>
</IIsCompressionSchemes>

Once the changes are done please save the metabase file.

2. Now goto command prompt and to the following location and type-

C:\Inetpub\AdminScripts>
adsutil set w3svc/filters/compression/parameters/HcDoSta
ticCompression false
HcDoStaticCompression : (BOOLEAN) False

C:\Inetpub\AdminScripts>adsutil set w3svc/filters/compression/parameters/HcDoDyn
amicCompression false
HcDoDynamicCompression : (BOOLEAN) False

C:\Inetpub\AdminScripts>adsutil set w3svc/1234/root/DoStaticCompression true
DoStaticCompression : (BOOLEAN) True

C:\Inetpub\AdminScripts>adsutil set w3svc/1234/root/DoDynamicCompression true
DoDynamicCompression : (BOOLEAN) True

Note: The value ’1234′ is website’s identifier. You can note this in IIS Manager > locate the website > note the identifier or you can find it in site’s logfile folder name for ex- w3svc1234

3. Finally restart IIS.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>