Enabling compression for drupal on Windows IIS

Backup existing configuration:

1.       Make a copy of the following file C:\Windows\system32\inetsrv\MetaBase.xml

2.       Right-click on Computer Name, click on All Tasks>>Backup/Restore Configuration and save file.

Configuring IIS via IIS Manager:

3.       Open IIS Manager from Administrative Tools>>Internet Information Services Manager or type inetmgr in the Run dialog box.

4.       Right-click on the top node, Internet Information Services, and check Enable Direct Metabase Edit

.

 5.       Right-click on the Web Sites node and click Properties. Go to Service tab. Ensure that Isolation mode is not selected (unchecked).

6.       Select(check) Compress application files and Compress static files

7.       Leave Temporary directory at default value(%windir%\IIS Temporary Compressed Files) and Maximum temporary directory size at Unlimited.

 

8.       Click Apply and OK 

9.       Right-click on the Web Service Extensions node and click Add a new Web service extension. Go to Service tab. The New Web Service Extension dialog box appears

 Web Service Extension-drupaldrive.com

10.   Name it as HTTP Compression. Click on Add. Choose C:\WINDOWS\system32\inetsrv\gzip.dll and OK. Check the Set extension status to Allowed and click OK. 

 

IIS 6.0 Metabase Configuration - MetaBase.xml

11.   Go to C:\Windows\System32\inetsrv Open MetaBase.xml in notepad and search for "/LM/W3SVC/Filters/Compression/gzip” section. Copy paste the below lines into this IISCompressionScheme section:

<IIsCompressionScheme   Location ="/LM/W3SVC/Filters/Compression/gzip"
                        HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
                        HcCreateFlags="1"
                        HcDoDynamicCompression="TRUE"
                        HcDoOnDemandCompression="TRUE"
                        HcDoStaticCompression="TRUE"
                        HcDynamicCompressionLevel="9"
                        HcFileExtensions="htm
                                        html
                                        txt
                                        js
                                        css
                                        ashx"
                        HcOnDemandCompLevel="9"
                        HcPriority="1"
                        HcScriptFileExtensions="php
                                        dll
                                        exe
                                        aspx"
        >
</IIsCompressionScheme>

12.   Final step is to restart IIS by right-clicking in Internet Information Services node and then clicking All Tasks >> Restart IIS

13.   Check your site at www.pipeboost.com to see if compression has been enabled correctly.

Pros:

1.       Compression results in page size reduction by almost 80%.

2.       Faster download and upload speeds for end-users.

3.       Reduced bandwidth consumption and network latency.

Cons:

1.       Higher CPU utilization, I/O rates. Not an issue for most servers unless you are running your site from an old system at home. CPU utilization in general runs upto 10% with this enabled.

2.       Older browsers do not support it correctly. Ex: Netscape on Windows 95

3.       Do not compress media files(jpg, gif, avi, mpeg) here. These should already be compressed and optimized for web by your photo/ video editing tools.

 

Share/Save