次の方法で共有


HcDoOnDemandCompression

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.

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.

Schema Attributes

Attribute Name

Value

ADSI/WMI Data Type

BOOL

ABO Data Type

DWORD_METADATA

Schema Default

TRUE

Internal Default

TRUE

Upper Bound

0

Lower Bound

Not specified

Internal ID

2215

Friendly ID

MD_HC_DO_ON_DEMAND_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