httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Jacobfeuerborn <>
Subject Re: [users@httpd] FilterProtocol cache=no not working correctly in 2.3.15?
Date Mon, 05 Dec 2011 19:33:57 GMT
On 12/05/2011 06:55 PM, Nick Kew wrote:
> On Mon, 05 Dec 2011 15:56:27 +0100
> Dennis Jacobfeuerborn<>  wrote:
>>> Just out of interest shouldn't the FilterProtocol directive with cache=no
>>> have the same effect as the flag and if I set the flag in the code can I
>>> remove the directive from the configuration (once cache prevention is
>>> working as intended)?
> That's what I'm hoping to establish.  We have a number of possibilities here:
> 1. A bug that affects both no-cache options.
> 2. A bug that affects the version you posted but not the one I'm suggesting.
> 3. Your report is missing something relevant, and consequently misleading.
> If (1) then I want to fix it, which means reproducing it first.
> If (3) then hopefully you'll get to the bottom of it, possibly with help.
> If (2) then I'd favour nuking the directive.
>> Ok, so I just noticed you were talking about
>> ap_register_output_filter_protocol() and not ap_register_output_filter() so
>> I guess the change above is pretty useless.
> Look at the header file.  ap_register_output_filter is from 2.0.  In 2.2
> it's just a #define, with the last argument (proto flags) zero.

Ok, so here is what I found out so far. First I commented out the 
FilterProtocol directive. Then I used the following to register the filter:

ap_register_output_filter_protocol("TESTFILTER", testfilter_filter, NULL, 

The result was that I still got a 304 response. Then I changed the code to 
this in order to make it more similar to what I expressed with the 
FilterProtocol directive:

ap_register_output_filter_protocol("ADVERT", advert_filter, NULL, 

With this I only get 200 responses as desired.

The only difference in the response is that in the first case I receive an 
Etag header and in the second case that header is not present.

So I modified the mod_filter code to remove the Etag header in addition to 
the Last-Modified header in the case of NO_CACHE and with that change I no 
longer get a 304 but the expected 200 response.

Then I retested the FilterProtocol directive. I removed the protocol flags 
from the module:

ap_register_output_filter_protocol("TESTFILTER", testfilter_filter, NULL, 

Then I re-inserted the FilterProtocol directive. The result is that the 
Etag reappears but also no Cache-Control header is sent so I get 304 
responses again. I added debug output in the filter function itself that 
outputs the content of f->frec->proto_flags which is 0x13 which corresponds 
So it seems the flags are set correctly but somehow ignored when the 
headers are supposed to be added/removed.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message