4

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?

Andy Hume
  • 40,474
  • 10
  • 47
  • 58

2 Answers2

2

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

Edward Anderson
  • 13,591
  • 4
  • 52
  • 48
-2

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

David Merrilees
  • 2,430
  • 2
  • 16
  • 15