What is the meaning of the HTTP header Vary:*

ⅰ亾dé卋堺 提交于 2019-11-30 19:15:58

Vary:* tells caches that the response has been chosen based on aspects beyond the usual aspects of HTTP content negotiation (e.g. Accept, Accept-Language, Accept-Charset).

Effectively this tells the cache not to cache the response. That is the meaning of "subsequent requests on that resource can only be properly interpreted by the origin server". The cache must forward these requests to the origin server.

Edit: Vary is orthogonal to caching. Consider this:

GET /foo HTTP/1.1

200 Ok Cache-Control: maxage=60 Content-Location: /foo.html Vary: *

Vary:* tells caches that the response cannot be cached for requests to /foo. But because of the Content-Location header, caches can still store the response for requests to /foo.html.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!