HttpCacheability 列舉

定義

提供用以設定 Cache-Control HTTP 標頭的列舉值。Provides enumerated values that are used to set the Cache-Control HTTP header.

public enum class HttpCacheability
public enum HttpCacheability
type HttpCacheability = 
Public Enum HttpCacheability
繼承
HttpCacheability

欄位

NoCache 1

設定 Cache-Control: no-cache 標頭。Sets the Cache-Control: no-cache header. 若不用欄位名稱,指出詞適用於全部要求並且共用 (Proxy 伺服器) 快取必須在滿足要求之前與原始 Web 伺服器強制進行成功的再驗證 (Revalidation)。Without a field name, the directive applies to the entire request and a shared (proxy server) cache must force a successful revalidation with the origin Web server before satisfying the request. 若使用欄位名稱,指出詞只用於該名稱的欄位;其餘的回應則可由共用快取提供。With a field name, the directive applies only to the named field; the rest of the response may be supplied from a shared cache.

Private 2

預設值。Default value. 設定 Cache-Control: private 以指示回應只能在用戶端做快取而非由共用 (Proxy 伺服器) 快取來進行。Sets Cache-Control: private to specify that the response is cacheable only on the client and not by shared (proxy server) caches.

Public 4

設定 Cache-Control: public 以指示回應可由用戶端和共用 (Proxy) 快取進行快取。Sets Cache-Control: public to specify that the response is cacheable by clients and shared (proxy) caches.

Server 3

指示回應只在原始伺服器進行快取。Specifies that the response is cached only at the origin server. NoCache 選項相似。Similar to the NoCache option. 用戶端會收到 Cache-Control: no-cache 指示詞,但文件會在原始伺服器上快取。Clients receive a Cache-Control: no-cache directive but the document is cached on the origin server. 相當於 ServerAndNoCacheEquivalent to ServerAndNoCache.

ServerAndNoCache 3

套用 ServerNoCache 設定,指出在伺服器上快取內容,但明確拒絕所有其他項的快取回應能力。Applies the settings of both Server and NoCache to indicate that the content is cached at the server but all others are explicitly denied the ability to cache the response.

ServerAndPrivate 5

指示只能在伺服器和用戶端上快取回應。Indicates that the response is cached at the server and at the client but nowhere else. Proxy 伺服器不能快取回應。Proxy servers are not allowed to cache the response.

備註

如需詳細資訊, 請移至 RFC 2616:超文字傳輸通訊協定--HTTP/1.1, 位於全球資訊網協會 (W3C)網站上。For more information, go to RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, on the World Wide Web Consortium (W3C) Web site. 特別是, 如需完整詳細資料, 請參閱第14.9 節「快取控制」和第13節「HTTP 中的快取」。In particular, for complete details, see Section 14.9 "Cache-Control" and Section 13, "Caching in HTTP."

注意

NoCache不會傳送一般 HTTP 1.0 要求Pragma: no-cache指示詞。NoCache does not send the common HTTP 1.0 request directive Pragma: no-cache.

適用於

另請參閱