Vignesh
Vignesh

Reputation: 55

max-age, no-Cache,must-revalidate on Cache-Control Header, Which takes predence here?

Cache-Control : max-age=86400, no-store, must-revalidate, no-cache

This is a response header set by the server for a JS file.

Does it mean the response is cached for 86400 seconds before revalidating?.

Which of the above one takes precedence and what is the resiult?.

Upvotes: 1

Views: 817

Answers (1)

Surender
Surender

Reputation: 757

Looks like no-cache is give precedence over all. HTTP1.1 specification says "If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server." Refer http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1

It also says "The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, more restrictive cache directive is also present. " Refer http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3

All the above are for HTTP/1.1 .

Upvotes: 2

Related Questions