]> granicus.if.org Git - apache/commitdiff
Don't spend cycles finding cache-control until we actually need it.
authorBill Stoddard <stoddard@apache.org>
Wed, 11 Dec 2002 21:53:22 +0000 (21:53 +0000)
committerBill Stoddard <stoddard@apache.org>
Wed, 11 Dec 2002 21:53:22 +0000 (21:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97871 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/mod_cache.c

index 9a299bd29f9da1ecd902eb526f0c79b5051b3241..a10643d5020bbe10fa7b5d9fc337aef5e789f33d 100644 (file)
@@ -419,7 +419,7 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in)
     int rv;
     request_rec *r = f->r;
     char *url = r->unparsed_uri;
-    const char *cc_out = apr_table_get(r->headers_out, "Cache-Control");
+    const char *cc_out;
     const char *exps, *lastmods, *dates, *etag;
     apr_time_t exp, date, lastmod, now;
     apr_off_t size;
@@ -516,8 +516,9 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in)
             lastmod = APR_DATE_BAD;
         }
 
-        /* read the etag from the entity */
+        /* read the etag and cache-control from the entity */
         etag = apr_table_get(r->headers_out, "Etag");
+        cc_out = apr_table_get(r->headers_out, "Cache-Control");
 
         /*
          * what responses should we not cache?