Udostępnij za pośrednictwem


HcDoOnDemandCompression Metabase Property

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

Boolean

WMI Data Type

Boolean

ADSI Data Type

Boolean

ABO Data Type

Boolean

ABO Metabase Identifier

MD_HC_DO_ON_DEMAND_COMPRESSION

Attributes

NO_ATTRIBUTES

Default Value

true

MetaFlagsEx

CACHE_PROPERTY_MODIFIED

User Type

IIS_MD_UT_SERVER

ID

2215

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

IIsCompressionScheme

/LM/W3SVC/Filters/Compression/Parameters

IIsCompressionSchemes

Code Example

For general code examples, see Code Examples to Configure Metabase Properties.