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
預設不會傳送標頭。
注意
此設定可讓您預設在用戶端上快取內容。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應