Commit 78401120 authored by Sander Striker's avatar Sander Striker
Browse files

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
parent dded1448
Loading
Loading
Loading
Loading
+6 −4
Changes for modules/cache/cache_storage.c: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -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");
                }

                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);
                    }