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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)