httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch>
Subject Re: mod_filter and adding to the Vary header in 2.2.x
Date Tue, 31 May 2011 21:19:21 GMT
On Tue, 31 May 2011, Graham Leggett wrote:

> On 31 May 2011, at 2:19 PM, Stefan Fritsch wrote:
>> if I use mod_filter to configure mod_deflate like this:
>> BrowserMatch ^Mozilla/4 no-gzip
>> BrowserMatch "\bMSIE [7-9]" !no-gzip
>> Header append Vary User-Agent env=!dont-vary
>> FilterDeclare compress-response
>> FilterProvider compress-response DEFLATE Content-Type $text/
>> FilterProvider compress-response DEFLATE Content-Type
>> $application/x-javascript
>> FilterProtocol compress-response change=yes;byteranges=no
>> How can I make sure in 2.2.x that the vary header is only added if the
>> DEFLATE filter is actually inserted into the filter chain?
> Surely the DEFLATE filter should be responsible for creating a Vary header, 
> and adding itself to a Vary header if one already exists?
> Or am I misunderstanding you?

The DEFLATE filter can't know which headers contributed to the decision if 
it is activated or not. The necessary Vary header depends on the 
configuration that inserts the filter and/or sets "no-gzip". Therefore, 
mod_filter would be a logical place to add the Vary header. Especially 
because it can also depend directly on request headers:

FilterProvider compress-response DEFLATE req=User-Agent !/MSIE/

But there isn't any code in mod_filter to add Vary headers.

View raw message