共用方式為


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

屬性值

如果啟用 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 預設不會傳送標頭。

注意

此設定可讓您預設在用戶端上快取內容。

適用於

另請參閱