缓存控制:在公共或最大年龄之前?

dyn*_*mic 9 header http

我相信它们都是等价的,但我相信我想要了解其他人.

哪个版本是正确的?

  1. Cache-Control: public, max-age=60

  2. Cache-Control: max-age=60, public

Que*_*det 20

这是RFC 7234中Cache-Control指令的语法:

Cache-Control   = 1#cache-directive
cache-directive = token [ "=" ( token / quoted-string ) ]
Run Code Online (Sandbox Code Playgroud)

1#cache-directive意味着你至少 需要一个cache-directive.由于publicmax-age都是Cache-Control指令,顺序无关紧要.