Is there ever any reason to respond with “Vary: *” and “Vary: Foo” for the same resource?

StackOverflow https://stackoverflow.com/questions/3529992

Pergunta

Is there any reason for a HTTP server to sometimes respond with Vary: *, and sometimes with Vary: Foo, to requests for the same resource?

What should a cache do, if after receiving (and caching) both responses, it then receives a request with a matching Foo header, for which the Vary: Foo response is suitable? Can it serve the matching response, or does the separate Vary: * response override it?

Outras dicas

There may be a situation where a server can guarantee that for a certain time a resource's representation is only influenced by Foo but after some time have elapsed, it can no longer make any guarantee and must set the header to Vary: *.

Expiration is preferred over validation. Since Vary: * forces revalidation, the cache should select the Foo response assuming it is fresh.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top