An Overview of IIS 7.5 Feature - Compression

This feature is helpful in transmitting large files over low bandwidth connection.

You can see my previous articles on IIS 7.5 Feature:

Let’s open IIS 7.5 manager and check whether Compression module is present or not under IIS section as shown below:

Compression

If it does not exist, we can install same by going “Turn on or off Windows Feature” in Control Panel and selecting same under Internet Information Services, WWW Services, then Performance Features.

Performance Features

Let’s select “Default Web Site”, double-click on Compression and understand its settings:

Default Web Site

Dynamic compression

Enabling it will compress all dynamic content like ASP or ASP.NET content and same will not be cached [response varies from user to user]. This will increase processor utilization and may affect server performance. We can also set attributes to stop compression based on CPU usage using dynamicCompressionEnableCpuUsage.

Static compression

Enabling it will compress and cache static content like images, css, js, html files in a directory specified at server level and same will be served to client browsers. We can even compress WORD, EXCEL files for faster download. After a file compression, subsequent requests will get a compressed copy of the file from cache directory.

We can set a size limit for compressing files, so that only files more than that size will get compressed.

compressing

IIS supports two types of compression: Deflate, GZip. It sends compressed content if client browser sends appropriate HTTP Accept-Encoding header. If client is not having HTTP compression capability, header will not be passed and IIS will send uncompressed data back.

Instead of IIS Manager, We can use appcmd.exe to configure it with the following command:

    C:\Windows\System32\inetsrv>appcmd.exe set config -section:system.webServer/http
    Compression /+"dynamicTypes.[mimeType=‘application/vnd.ms-powerpoint’,enabled='True']" /commit
    :apphost [ This will add powerpoint MIME type to dynamic compression types]

appcmd

Please ensure to use option /Commit:apphost to commit changes to correct location section in IIS configuration file [ApplicationHost.config].

I am ending  things here on compression, I hope this article will be helpful for all.
 
Read more articles on IIS:


Similar Articles