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 01/10] dont cache expired objects
Date Mon, 24 Jul 2006 00:50:31 GMT
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 on win32
since the URL is already cached.

Index: trunk/modules/cache/mod_cache.c
===================================================================
--- trunk.orig/modules/cache/mod_cache.c
+++ trunk/modules/cache/mod_cache.c
@@ -426,6 +426,11 @@ static int cache_save_filter(ap_filter_t
         /* 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 < r->request_time)
+    {
+        /* if a Expires header is in the past, don't cache it */
+        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