共用方式為


HttpCachePolicyWrapper.SetCacheability 方法

定義

Cache-Control 標頭設定為其中一個 HttpCacheability 值。

多載

SetCacheability(HttpCacheability)

Cache-Control 標頭設定為指定的 HttpCacheability 值。

SetCacheability(HttpCacheability, String)

Cache-Control 標頭設定為指定的 HttpCacheability 值,並將擴充功能附加至指示詞。

SetCacheability(HttpCacheability)

Cache-Control 標頭設定為指定的 HttpCacheability 值。

public:
 override void SetCacheability(System::Web::HttpCacheability cacheability);
public override void SetCacheability (System.Web.HttpCacheability cacheability);
override this.SetCacheability : System.Web.HttpCacheability -> unit
Public Overrides Sub SetCacheability (cacheability As HttpCacheability)

參數

cacheability
HttpCacheability

要設定標頭的目標 HttpCacheability 列舉值。

例外狀況

cacheability 不是其中一個列舉值。

適用於

SetCacheability(HttpCacheability, String)

Cache-Control 標頭設定為指定的 HttpCacheability 值,並將擴充功能附加至指示詞。

public:
 override void SetCacheability(System::Web::HttpCacheability cacheability, System::String ^ field);
public override void SetCacheability (System.Web.HttpCacheability cacheability, string field);
override this.SetCacheability : System.Web.HttpCacheability * string -> unit
Public Overrides Sub SetCacheability (cacheability As HttpCacheability, field As String)

參數

cacheability
HttpCacheability

要設定標頭的目標 HttpCacheability 列舉值。

field
String

要加入標頭中的快取控制項擴充功能。

例外狀況

fieldnull

cacheability 不是 PrivateNoCache

適用於