Compartilhar via


HcDoStaticCompression

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 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, 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 as needed, or, you can disable compression of static content server-wide, and then enable it only at the locations you specify.

To enable static compression server-wide, set the HcDoStaticCompression property to true at the IIS Admin Object Hierarchy level. You can then disable static file compression settings for an individual Web site or site element, for example, a virtual directory or file, by using the DoStaticCompression property at the individual site or site element level.

To disable static compression server-wide, set the HcDoStaticCompression property to false at the IIS Admin Object Hierarchy level. You can then enable static file compression for an individual Web site or site element, for example, a virtual directory or file, by using the DoStaticCompression property at the individual site or site element level.

If you change the value of this property at the IIS Admin Object Hierarchy level, the World Wide Web Publishing Service (WWW service) must be restarted before the change takes effect.

Schema Attributes

Attribute Name

Value

ADSI/WMI Data Type

BOOL

ABO Data Type

DWORD_METADATA

Schema Default

TRUE

Internal Default

FALSE

Upper Bound

0

Lower Bound

Not specified

Internal ID

2214

Friendly ID

MD_HC_DO_STATIC_COMPRESSION

Property Attributes

NO_ATTRIBUTES

User Type

IIS_MD_UT_SERVER

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

Flags

There are no flags for this property.

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

See Also