开发者

What does this kind of http header mean in symfony?

$this->getResponse()->addCacheControlHttpHeader('private=True');

What's 开发者_StackOverflowthat for,how does it work?


http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1

private:

Indicates that all or part of the response message is intended for a single user and MUST NOT be cached by a shared cache. This allows an origin server to state that the specified parts of the response are intended for only one user and are not a valid response for requests by other users. A private (non-shared) cache MAY cache the response. Note: This usage of the word private only controls where the response may be cached, and cannot ensure the privacy of the message content.


It's related with the cache control directive.

By default, pages protected with HTTP authentication are considered private; they will not be kept by shared caches. However, you can make authenticated pages public with a Cache-Control: public header; HTTP 1.1-compliant caches will then allow them to be cached.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜