HttpCacheability HttpCacheability HttpCacheability HttpCacheability Enum

定义

提供用于设置 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
继承
HttpCacheabilityHttpCacheabilityHttpCacheabilityHttpCacheability

字段

NoCache NoCache NoCache NoCache 1

设置 Cache-Control: no-cache 标头。Sets the Cache-Control: no-cache header. 如果没有字段名,则指令应用于整个请求,且在满足请求前,共享(代理服务器)缓存必须对原始 Web 服务器强制执行成功的重新验证。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 Private Private Private 2

默认值。Default value. 设置 Cache-Control: private 以指定响应只能缓存在客户端,而不能由共享(代理服务器)缓存进行缓存。Sets Cache-Control: private to specify that the response is cacheable only on the client and not by shared (proxy server) caches.

Public Public Public Public 4

设置 Cache-Control: public 以指定响应能由客户端和共享(代理)缓存进行缓存。Sets Cache-Control: public to specify that the response is cacheable by clients and shared (proxy) caches.

Server Server Server 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 ServerAndNoCache 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 ServerAndPrivate ServerAndPrivate ServerAndPrivate 5

指示响应只能在服务器和客户端缓存。Indicates that the response is cached at the server and at the client but nowhere else. 代理服务器不能缓存响应。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-cacheNoCache does not send the common HTTP 1.0 request directive Pragma: no-cache.

适用于

另请参阅