From 07a4681469ad2c54d8dec1c645ed29d9b3a31c30 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Thu, 12 Sep 2002 14:36:18 +0000 Subject: [PATCH] Do not cache responses to GET requests with query URLs if the origin server does not explicitly provide an Expires header on the response (RFC 2616 Section 13.9) Submitted by: Kris Verbeeck Reviewed by: Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96772 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/experimental/mod_cache.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index be428d831e..cf6158d465 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with Apache 2.0.41 + *) mod_cache: Do not cache responses to GET requests with query + URLs if the origin server does not explicitly provide an + Expires header on the response (RFC 2616 Section 13.9) + [Kris Verbeeck krisv@be.ubizen.com] *) Fix memory leak in core_output_filter. [Justin Erenkrantz] diff --git a/modules/experimental/mod_cache.c b/modules/experimental/mod_cache.c index e693508464..fcbb6676e2 100644 --- a/modules/experimental/mod_cache.c +++ b/modules/experimental/mod_cache.c @@ -538,6 +538,10 @@ static int cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in) && r->status != HTTP_NOT_MODIFIED) /* if a broken Expires header is present, don't cache it */ || (exps != NULL && exp == APR_DATE_BAD) + /* if query string present but no expiration time, don't cache it + * (RFC 2616/13.9) + */ + || (r->args && exps == NULL) /* if the server said 304 Not Modified but we have no cache * file - pass this untouched to the user agent, it's not for us. */ -- 2.40.0