Question

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?

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top