共用方式為


HttpResponse.CacheControl 屬性

定義

取得或設定 Cache-Control 與列 HttpCacheability 舉值相符的 HTTP 標頭。

public:
 property System::String ^ CacheControl { System::String ^ get(); void set(System::String ^ value); };
public string CacheControl { get; set; }
member this.CacheControl : string with get, set
Public Property CacheControl As String

屬性值

列舉值的字串表示 HttpCacheability

例外狀況

字串值集合與其中一個 HttpCacheability 列舉值不符。

備註

這些 、 PrivatePublicNo-Cache 的值為字串,必須以引號(「 」)包圍。 若 CacheControl 屬性設定為與列 HttpCacheability 舉值不符,則拋出 a ArgumentException 。 若未設定該 CacheControl 屬性,則回應的可快取性設定為 NoCache

CacheControl Expires, , 以及ExpiresAbsolute屬性已被棄用。 相反地,該 HttpCachePolicy 類別的方法可透過 Cache 內在物件來控制網際網路資訊服務(IIS)的輸出快取與用戶端快取。

適用於