You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Anthony Gerrard <an...@gmail.com> on 2009/09/02 20:18:09 UTC

[users@httpd] mod_cache ignores max-age / s-maxage headers if expires is set in the past

Hi,

I've noticed that if an expires header is set in the past then mod_cache will not cache the response even if s-maxage is set in the cache-control header.  Isn't this contrary to the HTTP 1.1 specification?

"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."

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3

Not caching responses with an expires header in the past seems to have been added deliberately in version 2.2.5.  The HTTP specification says it is valid to set conflicting expires and maxage / s-maxage settings to obtain different behaviour for HTTP 1.0 and HTTP 1.1 clients.  I'm using a caching product on my web server that behaves like this - hence I've noticed the problem.

I think I have a workaround but wanted to post something in case it is a bug.

Anthony
_______________________________________

Anthony Gerrard
Email: anthonygerrard@gmail.com
http://www.sponsorachild.org.uk

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org