OutputCacheSection.SendCacheControlHeader 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會取得或設定一個值,表示標頭是否 cache-control:private 預設由輸出快取模組傳送。
public:
property bool SendCacheControlHeader { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("sendCacheControlHeader", DefaultValue=true)]
public bool SendCacheControlHeader { get; set; }
[<System.Configuration.ConfigurationProperty("sendCacheControlHeader", DefaultValue=true)>]
member this.SendCacheControlHeader : bool with get, set
Public Property SendCacheControlHeader As Boolean
屬性值
true 若 cache-control:private 標頭已啟用 false,則 。 預設值為 true。
- 屬性
範例
以下程式碼範例說明如何使用該 SendCacheControlHeader 屬性。
// Get the current SendCacheControlHeader.
Boolean sendCacheControlHeaderValue =
outputCacheSection.SendCacheControlHeader;
// Set the SendCacheControlHeader.
outputCacheSection.SendCacheControlHeader = false;
' Get the current SendCacheControlHeader.
Dim sendCacheControlHeaderValue As [Boolean] = _
outputCacheSection.SendCacheControlHeader
' Set the SendCacheControlHeader.
outputCacheSection.SendCacheControlHeader = False
備註
此規則 SendCacheControlHeader 適用於未指定輸出快取的內容。 當它被設定為 false時, cache-control:private 標頭預設不會被傳送。
備註
此設定預設允許內容在用戶端快取。