Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

HcDoOnDemandCompression Metabase Property

Updated: August 22, 2005

Applies To: Windows Server 2003, Windows Server 2003 with SP1

The HcDoOnDemandCompression property specifies whether static files, such as .htm and .txt files, are compressed if a compressed version of the file does not exist in the compression directory specified by HcCompressionDirectory Metabase Property.

For on-demand compression of static files to occur, HcDoOnDemandCompression must be set to true at the global (IIsCompressionSchemes) level and at least one compression scheme (IIsCompressionScheme) level. The supported compression schemes are gzip and deflate. For information about the levels that this property can be set, see the Access Locations table.

If HcDoOnDemandCompression is set to true at the IIsCompressionScheme level and at least one IIsCompressionSchemes level, and IIS receives a request for static content, IIS checks the compression directory. If a corresponding compressed version of the requested file is not found, IIS will send an uncompressed version of the requested file to the client browser, while a background thread compresses the requested file. The newly compressed file is then stored in the compression directory, and subsequent requests for that file are serviced directly from the compression directory. In other words, an uncompressed version of the file is returned to the client, unless a compressed version of the file already exists in the compression directory.

If HcDoOnDemandCompression is set to false, at the global level, IIS does not compress static content files when a corresponding compressed version is not found in the compression directory.

If you change the value of HcDoOnDemandCompression at the individual compression scheme level, the World Wide Web Publishing Service (WWW service) must be restarted for the change to take effect.


Attribute Name Attribute Value

XML Data Type


WMI Data Type


ADSI Data Type


ABO Data Type


ABO Metabase Identifier




Default Value




User Type




Configurable Locations

You can configure this property at the following locations in the IIS metabase.


Metabase Path IIS Admin Object Type

/LM/W3SVC/Filters/Compression/gzip /LM/W3SVC/Filters/Compression/deflate




Code Example

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.