1

I'm wondering how browser would handle the situation when no-cache: "Set-Cookie" is presented in Cache-Control.

I did some research online and the result was different. Some say it won't cache set-cookie header, others say it won't cache the content if set-cookie header is presented. Here is one of the reference: https://www.w3.org/Protocols/HTTP/Issues/cache-private.html

The "no-cache" directive on a response message indicates that parts of the message must never be cached. If no list of field names is given, then the entire message must not be cached; otherwise, only the information within the header fields identified by the list of names must not be cached and the remainder of the message is believed to be cachable.

For example:

cache-control: public, max-age=2592000, no-cache="Set-Cookie"

Based on the research, public, max-age=2592000 tells browser to cache 30 days and not cache Set-Cookie header. However, I'm seeing all MISS in intermediate CDN.

shaochuancs
  • 15,342
  • 3
  • 54
  • 62
JLeGend
  • 11
  • 3

0 Answers0