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 if 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.

Data type Boolean
Default value TRUE
Inheritance Not inheritable

Access Locations

This property is accessible at the following locations:

Metabase Path Key Type
/LM/W3SVC/Filters/Compression/Parameters IIsCompressionSchemes
/LM/W3SVC/Filters/Compression/Scheme IIsCompressionScheme

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 DWORD_METADATA
User type IIS_MD_UT_SERVER