From: Graham Leggett Date: Tue, 26 Sep 2006 14:12:36 +0000 (+0000) Subject: Don't cache requests with a expires date in the past; otherwise mod_cache will X-Git-Tag: 2.3.0~2121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f5dee0d2cd1020e4668cbc9c5c5adfa73c5a9a9;p=thirdparty%2Fapache%2Fhttpd.git Don't cache requests with a expires date in the past; otherwise mod_cache will always try to cache the URL. This bug might lead to numerous rename() errors on win32 if the URL was previously cached. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@450055 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 192ea62c2bc..caf9d247767 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) mod_cache: Don't cache requests with a expires date in the past; + otherwise mod_cache will always try to cache the URL. This bug + might lead to numerous rename() errors on win32 if the URL was + previously cached. [Davi Arnaut ] + *) mod_disk_cache: Make sure that only positive integers are accepted for the CacheMaxFileSize and CacheMinFileSize parameters in the config file. PR39380 [Niklas Edmundsson ] diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index 2fc50733f00..3b34ee338ac 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -445,6 +445,11 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) /* if a broken Expires header is present, don't cache it */ reason = apr_pstrcat(p, "Broken expires header: ", exps, NULL); } + else if (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)