Bug 46346 - mod_cache logic misses some RFC valid cases
Summary: mod_cache logic misses some RFC valid cases
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_cache (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2008-12-05 00:31 UTC by Alex Polvi
Modified: 2009-01-09 01:49 UTC (History)
0 users



Attachments
caches any request that has an expires or cache control header (1.61 KB, patch)
2008-12-05 00:31 UTC, Alex Polvi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Polvi 2008-12-05 00:31:14 UTC
Created attachment 22996 [details]
caches any request that has an expires or cache control header

RFC2616 section 13.4 states that certain response status codes should not be cached, unless they contain a valid Expires or Cache Control header. mod_cache does not handle this correctly, keeping some requests from being cached.

For example, http://en-us.fxfeeds.mozilla.com/en-US/firefox/headlines.xml, returns the headers:

HTTP/1.1 302 Found
Expires: Fri, 05 Dec 2009 08:25:05 GMT
Content-Length: 323
Date: Fri, 05 Dec 2008 08:25:06 GMT
Location: http://fxfeeds.mozilla.com/firefox/headlines.xml
Server: Apache/2.2.3 (Red Hat)
Content-Type: text/html; charset=iso-8859-1
Keep-Alive: timeout=20, max=930
X-Cache-Info: cached
Connection: Keep-Alive

While a 302 would normally not be cached, since this request has an Expires header it should be. This patch adds logic to cache any response status code, if it has an Expires or Cache Control header.
Comment 1 Paul Querna 2008-12-06 22:34:21 UTC
Fixed in trunk r724093
Comment 2 Ruediger Pluem 2008-12-07 04:36:40 UTC
Proposed for backport as r724127.
Comment 3 Ruediger Pluem 2009-01-09 01:49:23 UTC
Backported as r727599