How to enable gZip on IIS7

Static and Dynamic Compression in IIS7
(via Remote IIS Manager)

Static Compression
This is used to provide file types that do not typically change, included but not limited to *.txt, *.css etc..

Dynamic Compression
This compression refer to the way it is distributed rather than the content type; using dynamic compression means that the compressed content is being generated each time, consuming server CPU and resources. This is used to provide for example pages that changes often such as ASP files.

Also check Deflate RFC and gZip RFC documentation.

How to install the proper compression
HTTP compression is usually available on the default installation of IIS 7. However, only static compression is installed by default. To install static or dynamic compression, use the following steps.

Windows Server 2008 or Windows Server 2008 R2
1. On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
2. In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
3. In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
4. On the Select Role Services page of the Add Role Services Wizard, select Dynamic Content Compression if you want to install dynamic compression and Static Content Compression if you want to install static compression, and then click Next.
5. On the Confirm Installation Selections page, click Install.
6. On the Results page, click Close.
For Reference check this picture on ImageShack.

Windows Vista or Windows 7
1. On the taskbar, click Start, and then click Control Panel.
2. In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
3. Expand Internet Information Services, then World Wide Web Services, then Performance Features.
4. Select Http Compression Dynamic if you want to install dynamic compression and Static Content Compression if you want to install static compression.
5. Click OK.
For Reference check this picture on ImageShack.

Enabling Compression for a website or application
1. Open Internet Information Services (IIS) Manager:
2. In the Connections pane, go to the connection, site, application, or directory for which you want to enable compression.
3. In the Home pane, double-click Compression.
4. In the Compression pane, check the boxes to enable static or dynamic compression, or remove the check marks to disable static or dynamic compression.
5. Once you have completed the above steps, click Apply in the Actions pane.

Enabling Compression for a server
1. Open Internet Information Services (IIS) Manager
2. In the Connections pane, highlight the name of your server.
3. In the server’s Home pane, double-click Compression.
4. In the Compression pane, check the boxes to enable static or dynamic compression, or remove the check marks to disable static or dynamic compression.
5. Once you have completed the above steps, click Apply in the Actions pane.

Configuring the ApplicationHost.config file
The following default <httpCompression> element is configured in the ApplicationHost.config file in IIS 7. This configuration section inherits the default configuration settings unless you use the <clear> element.


<httpCompression
directory=”%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files”>
<scheme name=”gzip” dll=”%Windir%\system32\inetsrv\gzip.dll” />
<dynamicTypes>
<add mimeType=”text/*” enabled=”true” />
<add mimeType=”message/*” enabled=”true” />
<add mimeType=”application/javascript” enabled=”true” />
<add mimeType=”*/*” enabled=”false” />
</dynamicTypes>
<staticTypes>
<add mimeType=”text/*” enabled=”true” />
<add mimeType=”message/*” enabled=”true” />
<add mimeType=”application/javascript” enabled=”true” />
<add mimeType=”*/*” enabled=”false” />
</staticTypes>
</httpCompression>

Tags: | Posted under Windows Server Admin | RSS 2.0

5 Comments on How to enable gZip on IIS7

  1. Avesta Sabetian Avesta says:

    Static Compression is enabled on all Arvixe servers. For configuring it per-site, this article assumes the user has administrative access to the server. As clients on shared servers do not have such access, for the end-client to configure it on their account per-site, remote IIS manager can be used:
    http://blog.arvixe.com/how-to-use-internet-information-services-iis-7-manager-to-connect-remotely-to-your-website/

  2. Emil says:

    This doesn’t help at all for shared web hosting. The option is grayed out in the IIS 7 server manager and it says

    “The dynamic content compression module is not installed.”

    Someone with administrator access needs to enable this feature on the server so that my website can use it.

  3. I discovered your weblog web site on google and check a number of of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Looking for forward to reading a lot more from you later on!?-

  4. Outstanding article! I wish I’d found this article earlier…

    Installing dynamic compression went smoothly.

    Thanks!

  5. Harish says:

    Very useful info. Nicely presented

    Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *


× 6 = 36

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>