Overview

Clarity is a web application, so web server compression can speed things up a bit for end users. By enabling web server compression, Internet Information Server (IIS) compresses all files sent to the client. If there are folks connecting on slow connections, this can really help. This is something that needs some baseline testing first. In some implementations, enabling compression can actually slow things down.

Implementing IIS Compression for Clarity

Below are the steps for implementing Internet Information Server server-side compression to support faster access over limited bandwidth connections to the Clarity server.

Step 1 – Baseline Test

Before doing anything, pick a long running report that returns a big dataset. Run this from a user’s workstation and time how long it takes for the report to appear after selecting page options. This is now our baseline for timing performance.

Step 2 – Check current compression settings

From the server, review and run the following batch file to check what the current settings are, and if you have the same version of IIS running.

HttpCompressionSettingsCheck.bat

@ECHO OFF
ECHO.
ECHO Checking settings for IIS6 HTTP Compression
ECHO.

cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/deflate/HcFileExtensions
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/deflate/HcDoStaticCompression
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/deflate/HcDynamicCompressionLevel
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/deflate/HcOnDemandCompLevel
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/deflate/HcScriptFileExtensions

cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/gzip/HcFileExtensions
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/gzip/HcDoStaticCompression
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/gzip/HcDynamicCompressionLevel
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/gzip/HcOnDemandCompLevel
cscript C:\Inetpub\AdminScripts\adsutil.vbs get /w3svc/filters/compression/gzip/HcScriptFileExtensions

ECHO.
ECHO.

ECHO Changes completed. Do an iisreset for changes to have effect!
ECHO.
PAUSE

Step 3 – Enable compression

From the server, review and run the following batch file to turn on the maximum level of compression.

HttpCompressionSettings.bat

@ECHO OFF
ECHO.
ECHO Adding “Best practice” settings for IIS6 HTTP Compression
ECHO.

cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcFileExtensions “css” “htm” “html” “txt” “js” “rdf” “vbs”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcDoStaticCompression “TRUE”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcDynamicCompressionLevel “9”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcOnDemandCompLevel “9”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcScriptFileExtensions “aspx” “asmx” “asbx” “ashx” “axd” “php” “asp”

cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcFileExtensions “css” “htm” “html” “txt” “js” “rdf” “vbs”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcDoStaticCompression “TRUE”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcDynamicCompressionLevel “9”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcOnDemandCompLevel “9”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcScriptFileExtensions “aspx” “asmx” “asbx” “ashx” “axd” “php” “asp”

ECHO.
ECHO.

ECHO Changes completed. Do an iisreset for changes to have effect!
ECHO.
PAUSE

 

Step 4 – Restart IIS

At this point, we need to restart IIS. This can be done many ways. One way is to run this command line as an administrator.

iisreset

Step 5 – Test against the baseline
Now that we have compression enabled, run the same test as before. Compare the time of the report from before and after to see if compression has had any effect. Be sure to run it a few times though. The first time, may run the same time or slower, but subsequent runs should be faster.

Step 6 – Decide if you want to rollback or not

At this point, the system could be faster, slower or unchanged. If you want to rollback and put things back the way they were, here is a batch file to set everything back to the default settings. If you do not want to rollback, then we are done.

HttpCompressionSettingsUndo.bat

@ECHO OFF
ECHO.
ECHO Reverting “Best practice” settings for IIS6 HTTP Compression to Default
ECHO.

cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcFileExtensions “htm” “html” “txt”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcDoStaticCompression “FALSE”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcDynamicCompressionLevel “0”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcOnDemandCompLevel “10”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/deflate/HcScriptFileExtensions “asp” “dll” “exe”

cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcFileExtensions “htm” “html” “txt”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcDoStaticCompression “TRUE”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcDynamicCompressionLevel “0”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcOnDemandCompLevel “10”
cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcScriptFileExtensions “asp” “dll” “exe”

ECHO.
ECHO.

ECHO Changes completed. Do an iisreset for changes to have effect!
ECHO.
PAUSE

Conclusion

As a web application, Clarity can benefit from some internet information server configuration tweaks, like enabling compression. Above are steps to check current compression settings, enable compression and rollback changes. As these are administrative tasks, there are risks involved. If you would like assistance with any of these items, please reach out to us at https://clearinsight.ca and we will be happy to help.