为缓存压缩内容指定的路径无效

Microsoft.Windows.InternetInformationServices.6.2.The.directory.specified.for.caching.compressed.content.is.invalid (Rule)

Knowledge Base article:

摘要

可以配置 Internet Information Services (IIS) World Wide Web 发布服务 (W3SVC) 来收集性能数据并进行 HTTP 压缩。 如果将 W3SVC 配置为执行 HTTP 压缩,则必须在 NTFS 卷中指定有效的压缩目录。

解决方法

检查压缩目录

IIS 使用可临时缓存静态文件的压缩版本的目录。默认目录为 %SystemDrive%\inetpub\temp\IIS Temporary Compressed Files。为提高文件查找速度和安全性,IIS 8 在此文件夹中为每个应用程序池创建一个子文件夹,且在每个应用程序池文件夹中为每个压缩架构创建一个子文件夹。

通过 IIS 管理器,可指定其他缓存文件夹。在服务器级别进行此设置。缓存文件夹设置存储在 httpCompression 部分的目录属性中,此部分位于 ApplicationHost.config 文件的 system.webServer 下。如果指定的目录位置不存在或无法访问,则将禁用静态压缩。

若要解决此错误,请通过 IIS 管理器检查当前配置的值。如果指定目录不存在,请创建此目录或指定一个真正存在的新位置。若要使用 IIS 管理器,请执行下列步骤。

若要通过 IIS 管理器修改压缩目录位置,请执行以下操作:

要详细了解 httpCompression 部分,请参阅 IIS 8: httpCompression 元素(IIS 设置架构)

Element properties:

TargetMicrosoft.Windows.InternetInformationServices.6.2.WebServer
CategoryAlert
EnabledTrue
Event_ID2264
Event SourceMicrosoft-Windows-IIS-W3SVC-WP
Alert GenerateFalse
RemotableTrue
Event LogApplication

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
WA WriteAction Microsoft.Windows.Server.IIS.6.2.GenerateAlertAction.SuppressedByDescription Default

Source Code:

<Rule ID="Microsoft.Windows.InternetInformationServices.6.2.The.directory.specified.for.caching.compressed.content.is.invalid" Enabled="true" Target="Microsoft.Windows.InternetInformationServices.6.2.WebServer" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Microsoft-Windows-IIS-W3SVC-WP</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>2264</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="Microsoft.Windows.Server.IIS.6.2.GenerateAlertAction.SuppressedByDescription">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Windows.InternetInformationServices.6.2.The.directory.specified.for.caching.compressed.content.is.invalid.AlertMessage"]$</AlertMessageId>
</WriteAction>
</WriteActions>
</Rule>