httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1023955 - /httpd/httpd/trunk/modules/cache/cache_util.c
Date Mon, 18 Oct 2010 19:11:11 GMT
Author: minfrin
Date: Mon Oct 18 19:11:10 2010
New Revision: 1023955

URL: http://svn.apache.org/viewvc?rev=1023955&view=rev
Log:
Be more efficient when handling the Expires header.

Modified:
    httpd/httpd/trunk/modules/cache/cache_util.c

Modified: httpd/httpd/trunk/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.c?rev=1023955&r1=1023954&r2=1023955&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.c Mon Oct 18 19:11:10 2010
@@ -451,7 +451,6 @@ int cache_check_freshness(cache_handle_t
     const char *cc_req;
     const char *pragma;
     const char *agestr = NULL;
-    const char *expstr = NULL;
     apr_time_t age_c = 0;
     cache_info *info = &(h->cache_obj->info);
     const char *warn_head;
@@ -514,8 +513,6 @@ int cache_check_freshness(cache_handle_t
     }
 
     /* These come from the cached entity. */
-    expstr = apr_table_get(h->resp_hdrs, "Expires");
-
     if (h->cache_obj->info.control.no_cache
             || h->cache_obj->info.control.no_cache_header
             || h->cache_obj->info.control.private_header) {
@@ -620,13 +617,14 @@ int cache_check_freshness(cache_handle_t
                                 "110 Response is stale");
             }
         }
+
         /*
          * If none of Expires, Cache-Control: max-age, or Cache-Control:
          * s-maxage appears in the response, and the response header age
          * calculated is more than 24 hours add the warning 113
          */
-        if ((maxage_cresp == -1) && (smaxage == -1) &&
-            (expstr == NULL) && (age > 86400)) {
+        if ((maxage_cresp == -1) && (smaxage == -1) && (apr_table_get(
+                h->resp_hdrs, "Expires") == NULL) && (age > 86400)) {
 
             /* Make sure we don't stomp on a previous warning, and don't dup
              * a 113 marning that is already present. Also, make sure to add



Mime
View raw message