HcDoOnDemandCompression Metabase Property (IIS 6.0)
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.
You can configure this property at the following locations in the IIS metabase.
For general code examples, see Code Examples to Configure Metabase Properties.