DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7847>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7847

Reverse proxy server caching 304 responses from origin server

           Summary: Reverse proxy server caching 304 responses from origin
                    server
           Product: Apache httpd-1.3
           Version: 1.3.24
          Platform: PC
               URL: http://www.dreo.dnd.ca   http://www.drdc-rddc.dnd.ca
        OS/Version: FreeBSD
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_proxy
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: [EMAIL PROTECTED]


Hello,

To start with Some Background follows

We are using Apache 1.3.24 as a reverse proxy server with caching enabled for
some internal web sites.  

We discovered that when we attempt to force a reload of the web page from the
origin server using our web browser, we are simply getting back a blank page.
This problem is reproducable.

This works in IE 5.5 and Mozilla 0.9.9 and Netscape 4.79.
To issue the reload from the origin server from IE 5.5, type "Ctrl-F5".
To issue the reload from the origin server from Mozilla and Netscape, hold
"Ctrl" and click the "Reload" button. By doing this, it sets "Cache-Control" in
the HTTP/1.1 request to "No cache".

We found that this only works when the origin server is MS IIS 4.0. When the
origin server is an Apache server, the web page is refreshed from the cache of
the reverse proxy server.

More Detailed Information

The Internal origin server is an MS IIS 4.0 for www.dreo.dnd.ca.  This will work
for any page that is cached on the reverse proxy server.  The page we will use
for testing is http://www.dreo.dnd.ca/ which has already been previously cached
on the reverse proxy server.

Using a sniffer on the reverse proxy server we determined what the HTTP/1.1
request was from the browser client:

GET / HTTP/1.1
Accept: */*
Accept-Language: en-us
Accept-Encoding:  gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE.5.5; Windows.NT 4.0)
Host: www.dreo.dnd.ca.
Connection: Keep-Alive
Cache-Control: no-cache

When the reverse proxy receives this request it forwards it onto the internal
origin server with a couple of additional fields (why does it send an HTTP/1.0
request instead of the original HTTP/1.1 request?) :

GET / HTTP/1.0
Host: www.dreo.dnd.ca
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Cache-Control: no-cache 
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
If-Modified-Since: Wed, 08 Nov 2000 18:10:04 GMT
If-None-Match: "c077721eaf49c01:1364"
X-Forwarded-For: xxx.xxx.244.1
Connection: close

The origin server then returns the following:

HTTP/1.1
304 Not Modified
Server: Microsoft-IIS/4.0 
Date: Thu, 04 Apr 2002 16:05:15 GMT
Content-Location: http://www.dreo.dnd.ca/index.html 
ETag: "c077721eaf49c01:1364"
Content-Length: 0

This "304 Not Modified" is then cached on the reverse proxy server and the
following is served back to the client with no HTML content from the previously
cached page (a blank page is displayed as a result):

HTTP/1.1
200 OK
Date: Thu, 04 Apr 2002 16:05:34 GMT
Server: Apache/1.3.24 (Unix)
Accept-Ranges: bytes
Content-Length: 0
Content-Location: http://www.dreo.dnd.ca/index.html
Content-Type: text/html
ETag:."c077721eaf49c01:1364"
Last-Modified: Wed, 08 Nov 2000 18:10:04 GMT
X-Cache: HIT from www.dreo.dnd.ca (with.revalidation)
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive

When the Internal origin server is Apache, the difference in the "304 Not
Modified" returned to the reverse proxy server is there is no "Content-Length:
0" header returned.

The error_log file (with debugging enabled) on the reverse proxy server shows
the following:

[Fri Apr  5 15:51:37 2002] [debug] proxy_cache.c(1018): Request for
http://www.dreo.dnd.ca/, pragma_req=(null), ims=0
[Fri Apr  5 15:51:37 2002] [debug] proxy_util.c(1373): File
/var/proxy/drdc/3G/mQ/sM/[EMAIL PROTECTED] not found
[Fri Apr  5 15:51:37 2002] [debug] proxy_cache.c(1271): Local copy not present
or expired. Declining.
[Fri Apr  5 15:51:38 2002] [debug] proxy_cache.c(1457): Expiry date is 0
[Fri Apr  5 15:51:38 2002] [debug] proxy_cache.c(1468): Expiry date calculated
1018126298
[Fri Apr  5 15:51:38 2002] [debug] proxy_cache.c(1575): Create temporary file
/var/proxy/drdc/tmpN80355
[Fri Apr  5 15:51:38 2002] [debug] proxy_http.c(537): Content-Type: text/html


[Fri Apr  5 15:51:51 2002] [debug] proxy_cache.c(1018): Request for
http://www.dreo.dnd.ca/, pragma_req=(null), ims=0
[Fri Apr  5 15:51:51 2002] [debug] proxy_cache.c(1271): Local copy not present
or expired. Declining.
[Fri Apr  5 15:51:51 2002] [debug] proxy_cache.c(1441): Reusing cached last 
modified
[Fri Apr  5 15:51:51 2002] [debug] proxy_cache.c(1457): Expiry date is 0
[Fri Apr  5 15:51:51 2002] [debug] proxy_cache.c(1468): Expiry date calculated
1018126311


The access_log shows the following on the reverse proxy server:

xxx.xxx.244.1 - - [05/Apr/2002:15:51:38 -0500] "GET / HTTP/1.1" 200 2557
xxx.xxx.244.1 - - [05/Apr/2002:15:51:51 -0500] "GET / HTTP/1.1" 200 0

If you think that there is something else that you need from us to debug this
let me know.

Thanks
Robert Tovell
[EMAIL PROTECTED]

Reply via email to