httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: PR 39643 revealed a problem between mod_cache and mod_filter
Date Thu, 25 May 2006 09:50:23 GMT


On 05/25/2006 09:02 AM, Nick Kew wrote:
> On Thursday 25 May 2006 06:56, Ruediger Pluem wrote:
> 
> 
> Which begs the question: why are we attaching output filters to mod_cache?

Because some module might offer a protocol or connection filter that should be
also run on cached content. e.g. core_insert_filter is triggered by ap_run_insert filter
to insert all filters set with SetOutputFilter. But looking at the code that
turns up the question for me if it is correct to start the filter chain with
r->output_filters in the case we are serving cached content. I guess we would need
to bypass all filters below the CACHE_OUT filter and start kicking off the filter chain
with this filter.

> 
> 
>>1. In mod_filter do a sanity check if the filter context has been
>>initialized. If not remove ourselves from the chain and simply pass the
>>brigade. This could be done by the following simple patch:
> 
> 
> If we have cached contents, it should presumably come from after
> any content-level filters, anyway.  So a cautious +1, with the caveat
> that if anyone is using mod_filter to configure connection-level filters,
> it might not be the ideal fix.

Provided that we do 2. it is just a sanity check.

> 
> Possibly a debug message.  Sod's law says someone will attach a
> filter to mod_cache output then need to debug why it doesn't work.

Sounds reasonable, but I talked about a debug message inside mod_filter.
So this would not help for arbitrary filters.

> 
> 
>>2. Convert ap_invoke_filter_init from a static function to a public
>>function that is part of the API and let mod_cache call it after
>>ap_run_insert_filter.
> 
> 
> Which would imply filtering on cached docs.  If we're going to
> do that, let's attach it to the normal handler, not quick_handler.

Not necessarily, because we could have protocol and network filters
that should also run on cached content (see above).

Mime
View raw message