如果相同的 URL 可以为相同的资源提供不同的内容类型,则 Vary 必须包含 Accept ? 或者浏览器缓存和代理是否将其理解为隐式?
例子:
GET /some/thing HTTP/1.1
Accept: application/json
这个回应
HTTP/1.1 200 OK
Transfer-Encoding: gzip
Content-Type: application/json
Cache-Control: max-age=3600, must-revalidate
Vary: Transfer-Encoding
{...}
或者这个
HTTP/1.1 200 OK
Transfer-Encoding: gzip
Content-Type: application/json
Cache-Control: max-age=3600, must-revalidate
Vary: Transfer-Encoding, Accept
{...}