]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
More mod_cache tweakage.
authorSander Striker <striker@apache.org>
Tue, 8 Feb 2005 22:23:31 +0000 (22:23 +0000)
committerSander Striker <striker@apache.org>
Tue, 8 Feb 2005 22:23:31 +0000 (22:23 +0000)
* 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

modules/cache/cache_storage.c

index ced8d738ee5df76d803e286428757c4a1befb677..a6bd26b82f3b2cf25142c8f26a25fe40e16318a7 100644 (file)
@@ -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);
                     }