Hello,
My configuration is :
- web server with Apache 1.3.33 (WEB)
- reverse-proxy with Apache 1.3.33 (tested with ProxyPass[Reverse] and
RewriteRule) (PROXY) (no DefaultType configured)
- reverse-cache-proxy with Apache 1.3.33 (CACHE)
When I do a request on a picture that return 304 (not modified) on WEB, it
returns
------------------------------------------------
HTTP/1.0 304 Not Modified
Date: Tue, 24 May 2005 17:23:36 GMT
Server: Apache
ETag: "7af-33-4194f50a"
------------------------------------------------
When I do the same request on PROXY, it returns
------------------------------------------------
HTTP/1.0 304 Not Modified
Date: Tue, 24 May 2005 17:23:30 GMT
Server: Apache
ETag: "7af-33-4194f50a"
X-Cache: MISS from WEB
Connection: close
Content-Type: text/plain
------------------------------------------------
And then the cache (CACHE) stores 'test/plain' as Content-Type, and remove the
good 'image/png' one.
There was an error like this with 'Content-Length': no content are returned
but "false/default" headers are store in the cache.
The patch, I send, remove all critical Content-... headers.
Benoit
--
Benoit DOLEZ, EXOSEC (http://www.exosec.fr/)
12 av des Pres - BL233, 78059 St Quentin en Yvelines cedex
Tel: +33 1 61 37 05 35 - Fax: +33 1 61 38 10 65
GSM: +33 6 71 01 69 32 - mailto:[EMAIL PROTECTED]
--- apache_1.3.33/src/modules/proxy/proxy_cache.c Tue Feb 17 22:52:22 2004
+++ apache_1.3.33-flx0.2/src/modules/proxy/proxy_cache.c Tue May 24
19:20:17 2005
@@ -1531,6 +1531,14 @@
buff[17 * (7) - 1] = '\n';
buff[17 * (7)] = '\0';
}
+ if (ap_table_get(resp_hdrs, "Content-Type"))
+ ap_table_unset(resp_hdrs, "Content-Type");
+ if (ap_table_get(resp_hdrs, "Content-MD5"))
+ ap_table_unset(resp_hdrs, "Content-MD5");
+ if (ap_table_get(resp_hdrs, "Content-Location"))
+ ap_table_unset(resp_hdrs, "Content-Location");
+ if (ap_table_get(resp_hdrs, "Content-Encoding"))
+ ap_table_unset(resp_hdrs, "Content-Encoding");
}
if (!ap_proxy_table_replace(c->hdrs, resp_hdrs)) {
c->xcache = ap_pstrcat(r->pool, "HIT from ",
ap_get_server_name(r), " (with revalidation)", NULL);