Does it make sense to have max-age and s-maxage in the Cache-Control HTTP header?

From HTTP Header Field Definitions:

14.9.3 Modifications of the Basic Expiration Mechanism

s-maxage

If a response includes an s-maxage directive, then for a shared cache (but not for a private cache), the maximum age specified by this directive overrides the maximum age specified by either the max-age directive or the Expires header.

Note, “overrides“. So, it would only make sense if you intend to specify a different maximum age for shared caches as compared to max-age, which would be used by end users.

In your particular example, they’re the same, so specifying s-maxage is just unnecessary.

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.