You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Sven Köhler <sk...@upb.de> on 2006/10/26 17:38:10 UTC

mod_deflate ignores Content-Encoding header

Hi,

imagine a simple CGI-script:


#!/usr/bin/perl
print "Content-Encoding: identity\n";
print "Content-Type: text/plain\n";
print "\n";
print "test";


AFAIK, "identity" indicates, that no transformation is being done on the
content.

IMHO, mod_deflate should implement the following logic:

Content-Encoding-header already present?
  yes: do nothing, just forward content
  no: add Content-Encoding header and do compression


That permits the applications to implement their own Content-Encoding
and it also permits them to disable the DEFLATE filter.


What do you think about it?
Does it make sense?


Re: mod_deflate ignores Content-Encoding header

Posted by Sven Köhler <sk...@upb.de>.
>> imagine a simple CGI-script:
>>
>>
>> #!/usr/bin/perl
>> print "Content-Encoding: identity\n";
>> print "Content-Type: text/plain\n";
>> print "\n";
>> print "test";
>>
>>
>> AFAIK, "identity" indicates, that no transformation is being done on the
>> content.
>>
>> IMHO, mod_deflate should implement the following logic:
>>
>> Content-Encoding-header already present?
>>   yes: do nothing, just forward content
>>   no: add Content-Encoding header and do compression
> 
> It's a valid behaviour.  So's the current one.

Hmm, but at the moment, mod_deflate just adds another
Content-Encoding-header, even if one is already present. That client
gets two of them. Is that intended?

On the other hand, mod_deflate doesn't need to recompress something,
that is already compression (when indicated by Content-Encoding header).

I don't think, that this cases are currently handled properly.
(I can at least confirm the double Content-Encoding header using the
CGI-script above)

> Putting it under the control of the admin is a reasonable
> proposition.  mod_filter does that: you can conditionally
> insert mod_deflate.

I'm trying to understand that mod_filter, but can i also insert a filter
if and only if the Content-Encoding-header is not already present in the
response?


Re: mod_deflate ignores Content-Encoding header

Posted by Nick Kew <ni...@webthing.com>.
On Thu, 2006-10-26 at 17:38 +0200, Sven Köhler wrote:
> Hi,
> 
> imagine a simple CGI-script:
> 
> 
> #!/usr/bin/perl
> print "Content-Encoding: identity\n";
> print "Content-Type: text/plain\n";
> print "\n";
> print "test";
> 
> 
> AFAIK, "identity" indicates, that no transformation is being done on the
> content.
> 
> IMHO, mod_deflate should implement the following logic:
> 
> Content-Encoding-header already present?
>   yes: do nothing, just forward content
>   no: add Content-Encoding header and do compression

It's a valid behaviour.  So's the current one.

Putting it under the control of the admin is a reasonable
proposition.  mod_filter does that: you can conditionally
insert mod_deflate.

-- 
Nick Kew