HttpCachePolicy HttpCachePolicy HttpCachePolicy HttpCachePolicy Class

定義

包含可以設定快取特定 HTTP 標頭,以及控制 ASP.NET 網頁輸出快取的方法。Contains methods for setting cache-specific HTTP headers and for controlling the ASP.NET page output cache.

public ref class HttpCachePolicy sealed
public sealed class HttpCachePolicy
type HttpCachePolicy = class
Public NotInheritable Class HttpCachePolicy
繼承
HttpCachePolicyHttpCachePolicyHttpCachePolicyHttpCachePolicy

備註

背景資訊關於 HTTP 標頭以及控制快取,請參閱 RFC 2616:超文字傳輸通訊協定,HTTP/1.1,位於World Wide Web Consortium (W3C) 網站For background information about HTTP headers and controlling caching, see RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, available on the World Wide Web Consortium (W3C) Web site.

屬性

UtcTimestampCreated UtcTimestampCreated UtcTimestampCreated UtcTimestampCreated

HttpCachePolicy 取得或設定以國際標準時間 (UTC) 呈現的時間戳記。Gets or sets the timestamp in Coordinated Universal Time (UTC) for the HttpCachePolicy.

VaryByContentEncodings VaryByContentEncodings VaryByContentEncodings VaryByContentEncodings

取得 Content-Encoding 標頭的清單用以區分輸出快取區。Gets the list of Content-Encoding headers that will be used to vary the output cache.

VaryByHeaders VaryByHeaders VaryByHeaders VaryByHeaders

取得所有 HTTP 標頭的清單用以區分快取輸出。Gets the list of all HTTP headers that will be used to vary cache output.

VaryByParams VaryByParams VaryByParams VaryByParams

取得由 HTTP GET 或 HTTP POST 接收之影響快取的參數清單。Gets the list of parameters received by an HTTP GET or HTTP POST that affect caching.

方法

AddValidationCallback(HttpCacheValidateHandler, Object) AddValidationCallback(HttpCacheValidateHandler, Object) AddValidationCallback(HttpCacheValidateHandler, Object) AddValidationCallback(HttpCacheValidateHandler, Object)

註冊目前回應的驗證回呼。Registers a validation callback for the current response.

AppendCacheExtension(String) AppendCacheExtension(String) AppendCacheExtension(String) AppendCacheExtension(String)

將指定的文字附加至 Cache-Control HTTP 標頭。Appends the specified text to the Cache-Control HTTP header.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetCacheability() GetCacheability() GetCacheability() GetCacheability()

取得 Cache-Control 指示詞。Gets the cache-control directive.

GetCacheExtensions() GetCacheExtensions() GetCacheExtensions() GetCacheExtensions()

取得快取延伸模組。Gets the cache extensions.

GetETag() GetETag() GetETag() GetETag()

取得 ETag。Gets the ETag.

GetETagFromFileDependencies() GetETagFromFileDependencies() GetETagFromFileDependencies() GetETagFromFileDependencies()

取得狀態,其指出是否已根據處理常式檔案相依性的時間戳記,設定 ETag 標頭。Gets the status indicating whether the ETag header has been set based on the timestamps of the file dependencies of the handler.

GetExpires() GetExpires() GetExpires() GetExpires()

取得已過期的標頭。Gets the expire header.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetIgnoreRangeRequests() GetIgnoreRangeRequests() GetIgnoreRangeRequests() GetIgnoreRangeRequests()

取得忽略範圍要求的狀態。Gets the status of ignore range requests.

GetLastModifiedFromFileDependencies() GetLastModifiedFromFileDependencies() GetLastModifiedFromFileDependencies() GetLastModifiedFromFileDependencies()

取得已設定為以處理常式檔案相依性時間戳記為根據的 Last-Modified 標頭狀態。Gets the status of the Last-Modified header set to base on the timestamps of the file dependencies of the handler.

GetMaxAge() GetMaxAge() GetMaxAge() GetMaxAge()

取得快取控制的最大存留期。Gets the cache-control max age.

GetNoServerCaching() GetNoServerCaching() GetNoServerCaching() GetNoServerCaching()

取得伺服器對目前回應進行快取的狀態。Gets the status of server caching for the current response.

GetNoStore() GetNoStore() GetNoStore() GetNoStore()

取得存放區的狀態。Gets the status of the store.

GetNoTransforms() GetNoTransforms() GetNoTransforms() GetNoTransforms()

取得 HTTP No-Transform 指示詞的狀態。Gets the status of the HTTP No-Transform Directive.

GetOmitVaryStar() GetOmitVaryStar() GetOmitVaryStar() GetOmitVaryStar()

取得 vary: 標頭的狀態。Gets the status of the vary: header.

GetProxyMaxAge() GetProxyMaxAge() GetProxyMaxAge() GetProxyMaxAge()

取得 HTTP Cache-Control︰Proxy 存留期上限。Gets the HTTP Cache-Control: Proxy Max Age.

GetRevalidation() GetRevalidation() GetRevalidation() GetRevalidation()

取得 Cache-Control︰此標頭可反映 must-revalidate 或 proxy-revalidate 指令。Gets the Cache-Control: header to reflect either the must-revalidate or proxy-revalidate directives.

GetType() GetType() GetType() GetType()

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

(Inherited from Object)
GetUtcLastModified() GetUtcLastModified() GetUtcLastModified() GetUtcLastModified()

以國際標準時間 (UTC) 取得 Last-Modified HTTP 標頭的值。Gets the value of the Last-Modified HTTP header in Coordinated Universal Time (UTC).

GetVaryByCustom() GetVaryByCustom() GetVaryByCustom() GetVaryByCustom()

取得用於變更 HTTP 快取的自訂字串。Gets the custom string that is used to vary the HTTP caching.

HasSlidingExpiration() HasSlidingExpiration() HasSlidingExpiration() HasSlidingExpiration()

取得值,指定快取是否具有滑動期限原則。Gets a value which specifies whether the cache has a sliding expiration policy.

IsModified() IsModified() IsModified() IsModified()

取得值,指定是否已修改 HTTP 快取。Gets a value which specifies whether the HTTP cache has been modified.

IsValidUntilExpires() IsValidUntilExpires() IsValidUntilExpires() IsValidUntilExpires()

取得值,這個值會指定 ASP.NET 快取是否應忽略使此快取無效之用戶端所傳送的 HTTP Cache-Control 標頭。Gets a value which specifies whether the ASP.NET cache should ignore HTTP Cache-Control headers sent by the client that invalidate the cache.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
SetAllowResponseInBrowserHistory(Boolean) SetAllowResponseInBrowserHistory(Boolean) SetAllowResponseInBrowserHistory(Boolean) SetAllowResponseInBrowserHistory(Boolean)

allow 參數為 true 時,讓回應在用戶端瀏覽器記錄快取中可用,而不考慮伺服器上的 HttpCacheability 設定。Makes the response is available in the client browser History cache, regardless of the HttpCacheability setting made on the server, when the allow parameter is true.

SetCacheability(HttpCacheability) SetCacheability(HttpCacheability) SetCacheability(HttpCacheability) SetCacheability(HttpCacheability)

Cache-Control 標頭設定為其中一個 HttpCacheability 值。Sets the Cache-Control header to one of the values of HttpCacheability.

SetCacheability(HttpCacheability, String) SetCacheability(HttpCacheability, String) SetCacheability(HttpCacheability, String) SetCacheability(HttpCacheability, String)

Cache-Control 標頭設定為其中一個 HttpCacheability 值,並且附加擴充功能到指示詞。Sets the Cache-Control header to one of the values of HttpCacheability and appends an extension to the directive.

SetETag(String) SetETag(String) SetETag(String) SetETag(String)

ETag HTTP 標頭設定為指定字串。Sets the ETag HTTP header to the specified string.

SetETagFromFileDependencies() SetETagFromFileDependencies() SetETagFromFileDependencies() SetETagFromFileDependencies()

根據處理常式的檔案相依性的時間戳記設定 ETag HTTP 標頭。Sets the ETag HTTP header based on the time stamps of the handler's file dependencies.

SetExpires(DateTime) SetExpires(DateTime) SetExpires(DateTime) SetExpires(DateTime)

設定 Expires HTTP 標頭為絕對日期和時間。Sets the Expires HTTP header to an absolute date and time.

SetLastModified(DateTime) SetLastModified(DateTime) SetLastModified(DateTime) SetLastModified(DateTime)

Last-Modified HTTP 標頭設定為提供的 DateTime 值。Sets the Last-Modified HTTP header to the DateTime value supplied.

SetLastModifiedFromFileDependencies() SetLastModifiedFromFileDependencies() SetLastModifiedFromFileDependencies() SetLastModifiedFromFileDependencies()

根據處理常式的檔案相依性的時間戳記設定 Last-Modified HTTP 標頭。Sets the Last-Modified HTTP header based on the time stamps of the handler's file dependencies.

SetMaxAge(TimeSpan) SetMaxAge(TimeSpan) SetMaxAge(TimeSpan) SetMaxAge(TimeSpan)

根據指定的時段設定 Cache-Control: max-age HTTP 標頭。Sets the Cache-Control: max-age HTTP header based on the specified time span.

SetNoServerCaching() SetNoServerCaching() SetNoServerCaching() SetNoServerCaching()

對目前回應停止所有原始伺服器的快取處理。Stops all origin-server caching for the current response.

SetNoStore() SetNoStore() SetNoStore() SetNoStore()

設定 Cache-Control: no-store HTTP 標頭。Sets the Cache-Control: no-store HTTP header.

SetNoTransforms() SetNoTransforms() SetNoTransforms() SetNoTransforms()

設定 Cache-Control: no-transform HTTP 標頭。Sets the Cache-Control: no-transform HTTP header.

SetOmitVaryStar(Boolean) SetOmitVaryStar(Boolean) SetOmitVaryStar(Boolean) SetOmitVaryStar(Boolean)

指定根據參數變化時,回應是否應包含 vary: 標頭。Specifies whether the response should contain the vary: header when varying by parameters.

SetProxyMaxAge(TimeSpan) SetProxyMaxAge(TimeSpan) SetProxyMaxAge(TimeSpan) SetProxyMaxAge(TimeSpan)

根據指定的時段設定 Cache-Control: s-maxage HTTP 標頭。Sets the Cache-Control: s-maxage HTTP header based on the specified time span.

SetRevalidation(HttpCacheRevalidation) SetRevalidation(HttpCacheRevalidation) SetRevalidation(HttpCacheRevalidation) SetRevalidation(HttpCacheRevalidation)

根據所提供的列舉值設定 Cache-Control HTTP 標頭為 must-revalidateproxy-revalidate 指示詞。Sets the Cache-Control HTTP header to either the must-revalidate or the proxy-revalidate directives based on the supplied enumeration value.

SetSlidingExpiration(Boolean) SetSlidingExpiration(Boolean) SetSlidingExpiration(Boolean) SetSlidingExpiration(Boolean)

將快取到期從絕對設為滑動。Sets cache expiration to from absolute to sliding.

SetValidUntilExpires(Boolean) SetValidUntilExpires(Boolean) SetValidUntilExpires(Boolean) SetValidUntilExpires(Boolean)

指定 ASP.NET 快取是否應該忽略使快取失效之用戶端所傳送的 HTTP Cache-Control 標頭。Specifies whether the ASP.NET cache should ignore HTTP Cache-Control headers sent by the client that invalidate the cache.

SetVaryByCustom(String) SetVaryByCustom(String) SetVaryByCustom(String) SetVaryByCustom(String)

指定用來區分快取輸出回應的自訂文字字串。Specifies a custom text string to vary cached output responses by.

ToString() ToString() ToString() ToString()

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

(Inherited from Object)

適用於