HTTP COMPRESSION MISSING-IN-ACTION (BEFORE)
HTTP COMPRESSION IN-ACTION (AFTER)
WHAT IS HTTP COMPRESSION?
According to RFC 2616, Internet HTTP Compression is a method to send, from the Web server, an HTTP response message in compressed format to a requesting Web browser.
This technology assumes that the Web server is capable of encoding the outbound content and the Web browser is capable of (automatically) decoding the received content.
HTTP Compression saves transfer data volume and speeds ups Web page load time. This short overview discusses various aspects of HTTP compression, suggest proven solutions, and gives hints to further reading.
HTTP REQUEST FLOW
When a Web browser loads a Web page, it opens a connection to the Web server and sends an HTTP request to the Web server. A typical HTTP request looks like this:
GET /index.html HTTP/1.1
With this request, the Web browsers asks for the object "
/index.html" on host "
www.http-compression.com". The browser identifies itself as "
Firefox/5.0" and claims that it can understand HTTP responses in gzip format.
After parsing and processing the client's request, the Web server may send the HTTP response in compressed format. Then a typical HTTP response looks like this:
HTTP/1.1 200 OK
[GZIP COMPRESSED DATA]
With this response, the Web server tells the browser with status code 200 that he could fulfil the request. In the next line, the Web server identifies itself as Apache. The line "Content-Type" says that it's an HTML document. The response header "Content-Encoding" informs the browser that the following data is compressed with gzip. Finally, the length of the compressed data is stated.
ENABLE HTTP COMPRESSION @ WEBSITE LEVEL
To more efficiently use available bandwidth, enable IIS HTTP compression. HTTP compression provides faster transmission time between compression-enabled browsers and IIS, regardless of whether your content is served from local storage or a UNC resource. You can compress static files and application response files. Compressing application response files is usually called dynamic compression.
Go to inetmgr > WebSites > Properties > Go to Service Tab
a. Select the checkbox – Compress application files (Dynamic files compression)
b. Select the checkbox – Compress static files (Static files compression)
Also, you can specify where to log/store temporary compressed content and the capacity of the temporary directory… Default value is 95MB, you can increase it based on the size of your static contents.
CONFIGURE IIS METABASE – DIRECT MANUPULATION OF METABASE XML
CONFIGURE IIS METABASE COMPRESSION PARAMETERS – USING SCRIPTS
IMPORTANT – Please make sure you follow these steps for any METABASE CHANGES
- STOP IIS
- Take BACKUP of METABASE XML
- Make changes as outlined below for IIS (using CSCRIPT)
- RESTART IIS
Run these commands – to configure static & dynamic compression parameters for both GZIP & Deflate compression schemes.
Note – you can dump below script commands in a batch file and execute it at command prompt on your Windows server
cscript C:\Inetpub\AdminScripts\adsutil.vbs Set W3SVC/Filters/Compression/Parameters/HcDoStaticCompression TRUE
5. Go to inetmgr > Default WebSite > Right click Properties > HTTPHeaders Tab