指定給快取處理壓縮內容的目錄無效

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 Publishing 服務 (W3SVC) 設定為收集效能資料和執行 HTTP 壓縮。 如果將 W3SVC 設定為執行 HTTP 壓縮,則必須指定一個位於 NTFS 磁碟區的有效壓縮目錄。

解決方式

檢查壓縮目錄

IIS 使用的目錄可讓您在其中暫時快取壓縮版本的靜態檔案。預設目錄是 %SystemDrive%\inetpub\temp\IIS Temporary Compressed Files。為改善檔案查閱次數和安全性,IIS 8 在此資料夾中針對每個應用程式集區建立一個子資料夾,並在每個應用程式集區資料夾中針對每個壓縮方法建立一個子資料夾。

您可使用 [IIS 管理員] 來指定不同的快取資料夾。此設定在伺服器層級進行。快取資料夾設定會儲存在 ApplicationHost.config 檔案中 system.webServer 下方的 httpCompression 區段裡的目錄屬性中。如果所指定的目錄位址不存在或無法存取,系統便會停用靜態壓縮。

若要解決此錯誤,請使用 [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>