httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zvi Har'El">
Subject proxy_cache handles "304 Not Modified" incorrectly
Date Mon, 06 May 2002 15:58:11 GMT
Dear Apache developers,

I have noticed today that when Microsoft-IIS/5.0 sends a "304 Not Modified"
response to IMS GET request, it (incorrectly IMHO) sends with it a
"Content-Length: 0" header. This is (again IMHO) a bug in IIS, but because of
that, IMS GET request with "Pragma: no-cache" headers are not handled
correctly: When the cache revalidation is done, in ap_proxy_cache_update(), the
content length is reset (in line 1481 in apache_1.3.24, line 1508 in the
current snapshot of apache_1.3.25-dev, file proxy_cache.c), before the status
is checked to be HTTP_NOT_MODIFIED (in line 1513 or 1547 resp). This makes the
erroneous Content-Length: 0 header replace the real length in the cache file
headers, and the file is destroyed. Not this doesn't happen without the
"Pragma: no-cache" header. A possible fix would be do ignore the
"Content-Length" in the response in case of "304 Not Modified", but I think
that perhaps no header in such a response should replace the cached headers!



Dr. Zvi Har'El     Department of Mathematics
tel:+972-54-227607                   Technion - Israel Institute of Technology
fax:+972-4-8324654     Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
                                   Monday, 25 Iyyar 5762,  6 May 2002,  6:42PM

View raw message