[This is preliminary documentation and subject to change]

### HcDoOnDemandCompression

This metabase property specifies whether static files, such as .htm and .txt files, will be compressed if no compressed version of the file exists in the directory specified by HcCompressionDirectory.

At a global level, if this property is set to TRUE, and IIS receives a request for static content, IIS will check the compression directory. If no corresponding compressed version of the requested file is found, IIS will send an uncompressed version of the requested file to the client browser while a background thread compresses the file. The newly compressed file will then be stored in the compression directory, and subsequent responses to requests for that file will be serviced directly from the directory.

If HcDoOnDemandCompression is set to FALSE at a global level, however, IIS will not compress static content files for which it finds no corresponding compressed version in the compression directory. In other words, an uncompressed version of the file will be returned for every request, unless a compressed version of the file already exists in the compression directory.

At an individual compression scheme level, HcDoOnDemandCompression indicates whether that particular compression scheme supports on-demand compression.

Because HcDoOnDemandCompression is not inheritable, in order for static on-demand compression to actually be enabled for a server, HcDoOnDemandCompression must be set to TRUE at both the global and individual scheme level.

If you change the value of this property at the individual compression scheme level, the Web service will need to be restarted for the change to take effect.

Attribute Name | Attribute Value
Data Type | BOOL
Attributes | NO_ATTRIBUTES
Default Value | TRUE
MetaFlagsEx | CACHE_PROPERTY_MODIFIED
User Type | IIS_MD_UT_SERVER
StartingNumber |
EndingNumber | 0
ID | 2215

### Access Locations

This property is accessible at the following locations:

Metabase Path | IIS Admin Object Type
/LM/W3SVC/Filters/Compression/gzip | IIsCompressionScheme
/LM/W3SVC/Filters/Compression/Parameters | IIsCompressionSchemes

### IIS Admin Base Object Information

The following table lists additional information required only for code that uses the IIS Admin Base Object.

Metabase identifier | MD_HC_DO_ON_DEMAND_COMPRESSION
Data type | BOOL
User type | IIS_MD_UT_SERVER

© 1997-2001 Microsoft Corporation. All rights reserved.