Hi,
It seems like mod_proxy_http is being cute and not sending an EOS bucket down the rest of the filter stack when it only receives headers. This (most likely) causes mod_cache's cache_save_filter to not be run when it receives a 304. Unfortunately I cannot 100% reproduce this locally, but the behaviour seems to be consistent on a solaris production machine which I can't fiddle about with too much (which includes testing this patch short term).
In short: Some eyes please...
Thanks,
Sander
--- Index: modules/proxy/mod_proxy_http.c =================================================================== --- modules/proxy/mod_proxy_http.c (revision 157814) +++ modules/proxy/mod_proxy_http.c (working copy) @@ -1331,9 +1331,21 @@ } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: end body send"); - } else { + } + else { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: header only"); + + /* Pass EOS bucket down the filter chain */ + e = apr_bucket_eos_create(c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, e); + if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS + || c->aborted) { + /* Ack! Phbtt! Die! User aborted! */ + backend->close = 1; /* this causes socket close below */ + } + + apr_brigade_cleanup(bb); } } while (interim_response);