You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mark Richards <ap...@msbr.net> on 2004/06/22 01:00:29 UTC

[users@httpd] Excluding by type on server response with mod_deflate

Hi,

We are using Apache 2.0.48 with mod_deflate (and mod_ssl) and we are
attempting to exclude compression of certain mime types based on the
server response. We have an application that serves many files types,
and the mime/type we are interested in is set on the server response.
For example, we have tried the following configuration, where we do not
want to compress zip files (note: the zip file name is not in the
request header).

<Location />
  SetOutputFilter DEFLATE
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

  SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
  SetEnvIfNoCase Request_URI "\.(?:zip|pdf)$" no-gzip dont-vary

  SetEnvIfNoCase Content-Type application/x-zip-compressed no-gzip
  dont-vary

   Header append Vary User-Agent env=!dont-vary
</Location>

This configuration does not work: it is ignoring the Content-Type on the
server response and zip files are being sent compressed.

We have also tried using AddOutputFilterByType DEFLATE, to only specify
those types we want compressing. Again, this does not appear to operate
on the server response Content-Type.

Are there any directives or mechanisms available to get mod_deflate to
operate correctly on the mime/type of the server response?

Many thanks,
Mark Richards.

p.s.
(A couple of our observations of AddOutputFilterByType DEFLATE:
 
    - we could only have one AddOutputFilterByType directive, otherwise
    only the last AddOutputFilterByType directive would operate.

    - wildcards were ignored e.g. AddOutputFilterByType application/ms* 
    We had to specify all types explicitly, and with a single
    AddOutputFilterByType directive.

    - did not appear to work on POSTs, only on GETs.)







 


---------------------------------------------------------------------
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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Excluding by type on server response with mod_deflate

Posted by Mark Richards <ap...@msbr.net>.
Nick,

Many thanks for clarifying the operation is on request and not server
response.  We'll work with that to find an appropriate solution. In the
meantime, here's hoping for the new framework to be included in 2.1.

Mark.

----- Original message -----
From: "Nick Kew" <ni...@webthing.com>
To: users@httpd.apache.org
Date: Tue, 22 Jun 2004 06:34:44 +0100 (BST)
Subject: Re: [users@httpd] Excluding by type on server response with
mod_deflate

On Mon, 21 Jun 2004, Mark Richards wrote:

> This configuration does not work: it is ignoring the Content-Type on the
> server response and zip files are being sent compressed.

This is a weakness of the 2.0 filtering model.  I have an updated
framework that fixes it, and the beginnings of a writeup that should
eventually become the basis for a proposal for a revised framework in
2.1 or (if that gets skipped) 2.2.

As of now you'll need to insert your own code.

-- 
Nick Kew

---------------------------------------------------------------------
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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Excluding by type on server response with mod_deflate

Posted by Nick Kew <ni...@webthing.com>.
On Mon, 21 Jun 2004, Mark Richards wrote:

> This configuration does not work: it is ignoring the Content-Type on the
> server response and zip files are being sent compressed.

This is a weakness of the 2.0 filtering model.  I have an updated
framework that fixes it, and the beginnings of a writeup that should
eventually become the basis for a proposal for a revised framework in
2.1 or (if that gets skipped) 2.2.

As of now you'll need to insert your own code.

-- 
Nick Kew

---------------------------------------------------------------------
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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org