How to add content types for HTTP compression in IIS 7.0

Article translations Article translations
Article ID: 969062 - View products that this article applies to.
Expand all | Collapse all

INTRODUCTION

This article describes how to add more content types for HTTP compression in Internet Information Services (IIS) 7.0.

Beginning in IIS 7.0, the HTTP compression is configured by specifying the MIME types that are to be compressed. This differs from earlier versions of IIS, in which compression is configured by specifying the file name extensions to be compressed. The ability to add, to modify, or to delete MIME types from the static and dynamic HTTP compression scheme is not exposed through the default IIS 7.0 user interface. To make these changes, you must use the Appcmd.exe command-line tool.

MORE INFORMATION

The following code examples show some of the Appcmd.exe syntax that you can use to add additional MIME types to the HTTP compression settings in IIS 7.0.
  • To add the "text/xml" MIME type to the static compression configuration for the whole web server, use the following command:
    appcmd set config /section:httpCompression /+staticTypes.[mimeType='text/xml',enabled='true'] /commit:apphost
  • To add the "application/octet-stream" MIME type to the dynamic compression configuration for the whole web server, use the following command:
    appcmd set config /section:httpCompression /+dynamicTypes.[mimeType='application/octet-stream',enabled='true'] /commit:apphost
  • You can also add wildcard entries for the MIME types. However, you can set MIME types for the web server level only. For example, to enable static compression for all MIME types for the default website, first add wildcard entries for the MIME types for the server level, and then enable static compression for the default website. To do this, run the following command:
    appcmd set config /section:httpCompression /staticTypes.[mimeType='*/*'].enabled:"true" /commit:apphost
    appcmd set config “Default Web Site” /section:urlCompression /doStaticCompression:”True”
    

REFERENCES

For more information about the changes that were made to compression in IIS 7.0, visit the following IIS website:
http://blogs.iis.net/ksingla/archive/2006/6/13/1313980.aspx
For more information about how to configure HTTP compression in IIS 7.0, visit the following Microsoft TechNet website:
http://technet2.microsoft.com/WindowsServer2008/en/library/30e64245-ec6b-4c4e-891b-b7249e36c0a01033.mspx
For more information about the Appcmd.exe tool in IIS 7.0, visit the following Microsoft TechNet website:
http://technet2.microsoft.com/windowsserver2008/en/library/ec52c53b-6aff-4d76-995e-3d222588bf321033.mspx

Properties

Article ID: 969062 - Last Review: September 21, 2010 - Revision: 2.0
APPLIES TO
  • Microsoft Internet Information Services 7.0
Keywords: 
kbexpertiseinter kbhowto kbsurveynew KB969062

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com