4
votes

I want to set a far future Expires headers to reduce requests made from individual browsers.

I'd also like to set Cache-Control: s-maxage=600 so that proxy caches (and CDNs) revalidate with the origin every 10 minutes for fresh content.

Will browsers honour the Expires header despite the existence of a Cache-Control header (which supposedly supersedes it) with a s-maxage directive?

2
That answer doesn't mention s-maxage.Andy Hume
You can see HTTP specification. "The s- maxage directive is always ignored by a private cache." w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3secondflying

2 Answers

2
votes

If a response includes both an Expires and a Cache-Control max-age directive, the max-age overrides the Expires header, even if the Expires header is more restrictive. This rule allows an origin server to provide, for a given response, a longer expiration time to an HTTP/1.1 cache than to an HTTP/1.0 cache.

Source: http://condor.depaul.edu/dmumaugh/readings/handouts/SE435/HTTP/node24.html

-2
votes

If both are included then both will be checked, neither has precedence. Max-age does not supersede expires, it's additional.