summaryrefslogtreecommitdiffstats
path: root/modules/cache/cache_util.c
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2010-10-18 21:11:10 +0200
committerGraham Leggett <minfrin@apache.org>2010-10-18 21:11:10 +0200
commit27f5e0099b7e3a19cb814fc09dcb3fb39fca7cf2 (patch)
tree0fcb27a36da537f52cd24fdd94e32e95e9831e94 /modules/cache/cache_util.c
parentRemove the remove_url filter consistently for both the ap_die() and the (diff)
downloadapache2-27f5e0099b7e3a19cb814fc09dcb3fb39fca7cf2.tar.xz
apache2-27f5e0099b7e3a19cb814fc09dcb3fb39fca7cf2.zip
Be more efficient when handling the Expires header.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023955 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/cache/cache_util.c')
-rw-r--r--modules/cache/cache_util.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c
index f463587726..6520665b3a 100644
--- a/modules/cache/cache_util.c
+++ b/modules/cache/cache_util.c
@@ -451,7 +451,6 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache,
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 *h, cache_request_rec *cache,
}
/* 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 *h, cache_request_rec *cache,
"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