On 12/05/2011 06:55 PM, Nick Kew wrote:
On Mon, 05 Dec 2011 15:56:27 +0100
Dennis Jacobfeuerborn<denni...@conversis.de> 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,
AP_FTYPE_CONTENT_SET, AP_FILTER_PROTO_NO_CACHE);
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,
AP_FTYPE_CONTENT_SET,
AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH|AP_FILTER_PROTO_NO_CACHE);
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,
AP_FTYPE_CONTENT_SET, 0);
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
to AP_FILTER_PROTO_CHANGE | AP_FILTER_PROTO_CHANGE_LENGTH |
AP_FILTER_PROTO_NO_CACHE.
So it seems the flags are set correctly but somehow ignored when the
headers are supposed to be added/removed.
Regards,
Dennis
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
" from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org