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


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.


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


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