You are currently offline, waiting for your internet to reconnect

How to add content types for HTTP compression in IIS 7.0

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:apphostappcmd 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:For more information about how to configure HTTP compression in IIS 7.0, visit the following Microsoft TechNet website:For more information about the Appcmd.exe tool in IIS 7.0, visit the following Microsoft TechNet website:
Properties

Article ID: 969062 - Last Review: 09/21/2010 18:55:00 - Revision: 2.0

Microsoft Internet Information Services 7.0

  • kbexpertiseinter kbhowto kbsurveynew KB969062
Feedback