HttpCacheVaryByHeaders.UserCharSet 屬性

定義

取得或設定值,指出 ASP.NET 輸出快取的快取回應是否依 Accept-Charset 標頭而有所不同,並且將此值附加至外送 Vary HTTP 標頭。

public:
 property bool UserCharSet { bool get(); void set(bool value); };
public bool UserCharSet { get; set; }
member this.UserCharSet : bool with get, set
Public Property UserCharSet As Boolean

屬性值

當 ASP.NET 輸出快取依 true 標頭而有所不同,並將它附加至傳送給用戶端的 Accept-Charset HTTP 標頭時,則為 Vary,否則為 false。 預設值是 false

範例

下列程式碼範例示範只有在 屬性為 trueUserCharSet ,才會執行某些動作。

Response.Cache.VaryByHeaders.UserCharSet = true;
Response.Cache.VaryByHeaders.UserCharSet = True

備註

標頭 Vary 會指出伺服器用來判斷哪些快取回應會傳送給用戶端要求的 request-header 欄位。 欄位 Accept-CharSet 會指定伺服器根據用戶端的字元集選取回應。

如需詳細資訊,請參閱 RFC 2616:超文字傳輸通訊協定 -- 可在萬維網聯盟 (W3C) 網站上取得的 HTTP/1.1。 如需完整詳細資料,請參閱第 14 節「標頭欄位定義」。

適用於