HcDoStaticCompression Metabase Property (IIS 6.0)
The HcDoStaticCompression property specifies whether responses to requests for static content, such as such as .htm and .txt files are compressed. Setting HcDoStaticCompression to true, indicates that static content is compressed when requested by a client. If static compression is enabled, each request for static content that contains the "Accept-Encoding: gzip" or "Accept-Encoding: deflate" header causes the content to be compressed, so long as the compression scheme specified in the header is enabled in IIS. If the request does not contain this header, or the header specifies a compression scheme that is not enabled in IIS, the content is not compressed.
If IIS determines that the response should be compressed, IIS checks the compression directory specified by the HcCompressionDirectory Metabase Property. If a fresh, compressed version of the static file is found in the directory, it is sent to the client browser. If a fresh, compressed version of the file is not found, and on-demand compression is enabled with HcDoOnDemandCompression Metabase Property, IIS sends the requested file in uncompressed form, and adds that file to the background compression queue.
At the individual compression scheme level (IIsCompressionScheme), the HcDoStaticCompression property determines which compression schemes IIS will support for static content: gzip, deflate, or both.
You can either enable compression of static content server-wide and then disable it at specific locations, or you can disable compression of static content server-wide and then enable it only at the locations you specify. To enable and disable static compression by using the HcDoStaticCompression property, do the following:
If you change the value of the HcDoStaticCompression property at the IIsCompressionScheme level, the World Wide Web Publishing Service (WWW service) must be restarted before the change takes 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.