From: Sander Striker Date: Tue, 8 Feb 2005 22:23:31 +0000 (+0000) Subject: More mod_cache tweakage. X-Git-Tag: 2.1.3~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=876ee190138dea29637c7f17ae5fc1b10357877e;p=thirdparty%2Fapache%2Fhttpd.git More mod_cache tweakage. * modules/cache/cache_storage.c (cache_select_url): Add If-Modified-Since regardless of having an ETag or not. See: RFC2616, 14.26. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152948 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/cache_storage.c b/modules/cache/cache_storage.c index ced8d738ee5..a6bd26b82f3 100644 --- a/modules/cache/cache_storage.c +++ b/modules/cache/cache_storage.c @@ -249,19 +249,21 @@ int cache_select_url(request_rec *r, char *url) const char *etag, *lastmod; /* Make response into a conditional */ + /* FIXME: What if the request is already conditional? */ etag = apr_table_get(h->resp_hdrs, "ETag"); - if (!etag) { - lastmod = apr_table_get(h->resp_hdrs, "Last-Modified"); - } + lastmod = apr_table_get(h->resp_hdrs, "Last-Modified"); + if (etag || lastmod) { - /* if we have a cached etag or Last-Modified */ + /* If we have a cached etag and/or Last-Modified */ + cache->stale_headers = apr_table_copy(r->pool, r->headers_in); if (etag) { apr_table_set(r->headers_in, "If-None-Match", etag); } - else if (lastmod) { + + if (lastmod) { apr_table_set(r->headers_in, "If-Modified-Since", lastmod); }