共用方式為


OutputCacheSection.SendCacheControlHeader 屬性

定義

會取得或設定一個值,表示標頭是否 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

屬性值

truecache-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 標頭預設不會被傳送。

備註

此設定預設允許內容在用戶端快取。

適用於

另請參閱