httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] Use Apache for compression offloading
Date Tue, 24 Jun 2008 10:53:46 GMT
Hi again.
This is an amendment to my previous answer.

André Warnier wrote:
> Rainer Sabelka wrote:
>> On Tuesday 24 June 2008 09:22:47 André Warnier wrote:
>>> Hi.
> [...]
>> Hm. I think the check for the Accept-encoding header is hard-coded in 
>> mod_deflate. No matter if I SetOutputFilter DEFLATE conditionally or 
>> unconditionally, the filter won't compress the output as soon as I 
>> unset the Accept-encoding header.
> Hmm. It gets more interesting.
> Then you probably have to be more sneaky still.
> What about this :
> - if there is a request Accept-Encoding header, you unset it, but set a 
> variable
> - you proxy the request
> - you set a first output filter which tests if the variable is set, and 
> if so re-adds an Accept-Encoding header
> - you add the DEFLATE filter
> The above is based on the presumption that you can add output filters in 
> the order you want.  And also that writing (or finding) the first output 
> filter I mention is feasible/easy.
> I would know how to do the above easily using mod_perl (and a bit 
> differently), but I presume there must be other methods, if you don't 
> already use mod_perl.

Looking at the mod_deflate documentation, I see the following note :

There is a environment variable force-gzip, set via SetEnv, which will 
ignore the accept-encoding setting of your browser and will send 
compressed output.

So, maybe the following would work :
- set the DEFLATE output filter
- if (and only if) there is an Accept-Encoding header, unset it but set 
- proxy the request
- that's it.

Like (requires mod_setenvif amd mod_headers) :
SetEnvIf Accept-encoding "gzip" force-gzip
Header unset Accept-encoding env=force-gzip
SetOutputFilter DEFLATE

No ?

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