What is the risk of having HTTP header “Cache-Control: public”?

前端 未结 2 1059
不知归路
不知归路 2020-12-25 10:48

The Cache-Control HTTP/1.1 header can specify max-age as well as whether the cache content can be public or private, indicating whether intermediate cache can c

2条回答
  •  别那么骄傲
    2020-12-25 11:04

    I further found the following spec:

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

    public

    Indicates that the response MAY be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache. (See also Authorization, section 14.8, for additional details.)

    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.

    So it looks like it is more about "shared cache" instead of intermediate cache.

提交回复
热议问题