如何强制服务器绕过缓存进行HTTP POST



客户端是否可以在生成响应时强制源服务器忽略其缓存?例如,它可以在请求中发送Cache-Control: no-cache吗?RFC似乎只是在响应的上下文中讨论Cache-Control: no-cache,而不是在请求的上下文中。

回答我自己的问题。。。

根据http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.1.6:

A client's request MAY specify the maximum age it is willing to accept of an unvalidated response; specifying a value of zero forces the cache(s) to revalidate all responses.

根据http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4

The request includes a "no-cache" cache-control directive [...] The server MUST NOT use a cached copy when responding to such a request.

最新更新