httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davi Arnaut <d...@haxent.com.br>
Subject [PATCH] Don't cache expired objects
Date Wed, 14 Jun 2006 19:53:50 GMT
Hi,

Don't cache requests with a expires date in the past; otherwise the cache code
will _always_ try to cache the URL, leading to numerous rename() errors - since
the URL is already cached.

--
Davi Arnaut

Index: modules/cache/mod_cache.c
===================================================================
--- modules/cache/mod_cache.c	(revision 414393)
+++ modules/cache/mod_cache.c	(working copy)
@@ -426,6 +426,9 @@
         /* if a broken Expires header is present, don't cache it */
         reason = apr_pstrcat(p, "Broken expires header: ", exps, NULL);
     }
+    else if (exps != NULL && exp != APR_DATE_BAD && exp < apr_time_now())
{
+        reason = "Expires header already expired, not cacheable";
+    }
     else if (r->args && exps == NULL) {
         /* if query string present but no expiration time, don't cache it
          * (RFC 2616/13.9)

Mime
View raw message