HttpCacheVaryByHeaders 類別

定義

提供類型安全方式來設定 VaryByHeaders 屬性。Provides a type-safe way to set the VaryByHeaders property.

public ref class HttpCacheVaryByHeaders sealed
public sealed class HttpCacheVaryByHeaders
type HttpCacheVaryByHeaders = class
Public NotInheritable Class HttpCacheVaryByHeaders
繼承
HttpCacheVaryByHeaders

備註

VaryByHeaders屬性會識別當資源有多個快取回應時,ASP.NET 用來唯一識別回應變化的要求標頭參數。The VaryByHeaders property identifies which request header parameters ASP.NET uses to uniquely identify a variation of the response when there are multiple cached responses for a resource. 當回應取決於一組用戶端輸入(例如標頭或參數)時,這會很有用。This is useful when a response depends on a set of client inputs, such as headers or parameters.

HttpCacheVaryByHeaders HTTP 快取控制標頭不直接相關,但有助於確保用戶端或 proxy 因指定的標頭而異。The HttpCacheVaryByHeaders is not directly related to HTTP cache-control headers, but helps ensure that a client or proxy varies by the specified headers. 如需的詳細資訊 VaryByHeaders ,請參閱 全球資訊網協會 (W3C) 網站上提供的 RFC 2616:超文字傳輸通訊協定--HTTP/1.1。For more information about VaryByHeaders, see RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, available on the World Wide Web Consortium (W3C) Web site. 如需完整詳細資料,請參閱第14節「標頭欄位定義」。See section 14, "Header Field Definitions", for complete details.

建構函式

HttpCacheVaryByHeaders()

初始化 HttpCacheVaryByHeaders 類別的新執行個體。Initializes a new instance of the HttpCacheVaryByHeaders class.

屬性

AcceptTypes

取得或設定值,指出 ASP.NET 輸出快取的快取回應是否依 Accept HTTP 標頭而有所不同,並且將此值附加至外送 Vary HTTP 標頭。Gets or sets a value indicating whether the ASP.NET output cache varies the cached responses by the Accept HTTP header, and appends it to the out-going Vary HTTP header.

Item[String]

取得或設定自訂標頭欄位,ASP.NET 輸出快取的快取回應會依此自訂標頭欄位而有所不同,並且將此自訂標頭欄位附加至外送 Vary HTTP 標頭。Gets or sets a custom header field that the ASP.NET output cache varies the cached responses by, and appends it to the out-going Vary HTTP header.

UserAgent

取得或設定值,指出 ASP.NET 輸出快取的快取回應是否依 User-Agent 標頭而有所不同,並且將此值附加至外送 Vary HTTP 標頭。Gets or sets a value indicating whether the ASP.NET output cache varies the cached responses by the User-Agent header, and appends it to the out-going Vary HTTP header.

UserCharSet

取得或設定值,指出 ASP.NET 輸出快取的快取回應是否依 Accept-Charset 標頭而有所不同,並且將此值附加至外送 Vary HTTP 標頭。Gets or sets a value indicating whether the ASP.NET output cache varies the cached responses by the Accept-Charset header, and appends it to the out-going Vary HTTP header.

UserLanguage

取得或設定值,指出 ASP.NET 輸出快取的快取回應是否依 Accept-Language 標頭而有所不同,並且將此值附加至外送 Vary HTTP 標頭。Gets or sets a value indicating whether the ASP.NET output cache varies the cached responses by the Accept-Language header, and appends it to the out-going Vary HTTP header.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetHeaders()

取得值的陣列,這些值會指定要用來改變快取的 HTTP 標頭。Gets an array of values which specify the HTTP headers to be used for varying the cache.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SetHeaders(String[])

設定值的陣列,這些值會指定要用來改變快取的 HTTP 標頭。Sets an array of values which specify the HTTP headers to be used for varying the cache.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
VaryByUnspecifiedParameters()

造成 ASP.NET 依所有標頭值而有所不同,並將 Vary HTTP 標頭設為 * 值 (星號)。Causes ASP.NET to vary by all header values and sets the Vary HTTP header to the value * (an asterisk). 所有其他 Vary 標頭資訊都會被捨棄。All other Vary header information to be dropped.

適用於

另請參閱