Bug 23129 - mod_proxy does not cache content with valid Expires header
Summary: mod_proxy does not cache content with valid Expires header
Status: RESOLVED WONTFIX
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 1.3.28
Hardware: All All
: P3 major with 3 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2003-09-12 09:37 UTC by Bjorn Stabell
Modified: 2007-08-02 12:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjorn Stabell 2003-09-12 09:37:42 UTC
This bug was first reported by James Cooper in 1999
(http://archive.apache.org/gnats/4089), but was somehow never included.

Searching the web it is obvious that many people have found this bug through 
the years, but none (except James) have reported it.  Instead, it's 
become "common knowledge" that for mod_proxy in Apache to cache content, it has 
to have a Last-Modified header.  Just having an Expires header is not enough; 
it will always result in a X-Cache: MISS

Last-Modified headers do not really make sense for dynamic content, so many 
HTTP Accelerator plugins for dynamic websites only generate Expires headers, 
assuming that it'll work fine, when it doesn't.

This patch fixes this deficiency for 1.3.28:

*** proxy_cache.c-org	Fri Sep 12 15:36:59 2003
--- proxy_cache.c	Fri Sep 12 16:43:12 2003
***************
*** 1395,1403 ****
          (r->status == HTTP_NOT_MODIFIED && (c == NULL || c->fp == NULL)) ||
  
      /*
!      * 200 OK response from HTTP/1.0 and up without a Last-Modified header
       */
!         (r->status == HTTP_OK && lmods == NULL && is_HTTP1) ||
  
      /* HEAD requests */
          r->header_only ||
--- 1397,1408 ----
          (r->status == HTTP_NOT_MODIFIED && (c == NULL || c->fp == NULL)) ||
  
      /*
!      * 200 OK response from HTTP/1.0 and up
!      * without a Last-Modified or a valid Expires header
       */
!         (r->status == HTTP_OK && is_HTTP1
! 	 && lmods == NULL
! 	 && (expire == NULL || expc == BAD_DATE)) ||
  
      /* HEAD requests */
          r->header_only ||
Comment 1 Jeff Trawick 2003-11-21 18:20:31 UTC
I'm going through the bug db to make sure patches are findable.  Please see 
http://httpd.apache.org/dev/patches.html