You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Cabbar Duzayak <ca...@gmail.com> on 2006/12/08 05:35:52 UTC

[users@httpd] Going crazy over mod_deflate

Before I start, I am using apache 2.0.52 with PHP 4.3.9.

In my .htaccess, I have a rewrite rule that rewrites /bb.flv as
/bb.php, and this bb.php file reads a flv file and outputs it. In the
PHP file, I am specifying content-type as video/x-flv and
content-length, however mod_deflate still compresses this, and also
removes the content-length header from the response, and this messes
up the flv player!...

I tried everything, simply everything, and yet could not get
mod_deflate to by-pass this file. For some reason, it does not see
this content as video/x-flv, and treats is as regular text???? And,
when I disable the mod_deflate filter, everything returns back to
normal. BTW, I am not doing any compression on the PHP side!...

Things I tried are:

+ AddOutputFilterByType DEFLATE text/html text/plain text/xml

+ SetEnvIfNoCase Request_URI \
  \.(?:gif|jpe?g|png|flv)$ no-gzip dont-vary

I tried putting these in <directory>, <location>, <virtual> and global
context, and none of them worked. Additionally, I tried to rewrite the
type using the rewriterule as:
RewriteRule ^bb.flv /bb.php [T=video/x-flv]

I also tried ForcedType, AddTpe, AddOutputFilter (by extension), etc. etc.

But, still the output is compressed. And, the response headers I am seeing are:

content-disposition: inline; filename=123.flv
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=5, max=96
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: video/x-flv

Can you please tell what I am missing here and/or is there anyway I
can by-pass the mod_deflate compression?

TIA.

---------------------------------------------------------------------
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] Going crazy over mod_deflate

Posted by Joshua Slive <jo...@slive.ca>.
On 12/7/06, Cabbar Duzayak <ca...@gmail.com> wrote:
> Before I start, I am using apache 2.0.52 with PHP 4.3.9.

Rather old version.  Everything filter-related is cleaner and more
flexible in 2.2.

> + AddOutputFilterByType DEFLATE text/html text/plain text/xml

You may or may not have some other directive elsewhere in httpd.conf
that is adding the DEFALTE filter more aggressively.  But in general,
my advice is to ignore AddOutputFilterByType, because it doesn't work
consistently.  Select the specific filename extensions or locations
that you wish to DEFLATE and then use AddOuputFilter/SetOutputFilter
only on those locations.

Joshua.

---------------------------------------------------------------------
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] Going crazy over mod_deflate

Posted by Yvo van Doorn <yv...@gmail.com>.
Please make sure you are using the latest version of Apache and PHP (4.4.4),
as those are bug fix releases in order to make life in general easier. Not
to mention that PHP 4.3.9 has some incredibly huge security holes.

On 12/7/06, Cabbar Duzayak <ca...@gmail.com> wrote:
>
> Before I start, I am using apache 2.0.52 with PHP 4.3.9.
>
> In my .htaccess, I have a rewrite rule that rewrites /bb.flv as
> /bb.php, and this bb.php file reads a flv file and outputs it. In the
> PHP file, I am specifying content-type as video/x-flv and
> content-length, however mod_deflate still compresses this, and also
> removes the content-length header from the response, and this messes
> up the flv player!...
>
> I tried everything, simply everything, and yet could not get
> mod_deflate to by-pass this file. For some reason, it does not see
> this content as video/x-flv, and treats is as regular text???? And,
> when I disable the mod_deflate filter, everything returns back to
> normal. BTW, I am not doing any compression on the PHP side!...
>
> Things I tried are:
>
> + AddOutputFilterByType DEFLATE text/html text/plain text/xml
>
> + SetEnvIfNoCase Request_URI \
>   \.(?:gif|jpe?g|png|flv)$ no-gzip dont-vary
>
> I tried putting these in <directory>, <location>, <virtual> and global
> context, and none of them worked. Additionally, I tried to rewrite the
> type using the rewriterule as:
> RewriteRule ^bb.flv /bb.php [T=video/x-flv]
>
> I also tried ForcedType, AddTpe, AddOutputFilter (by extension), etc. etc.
>
> But, still the output is compressed. And, the response headers I am seeing
> are:
>
> content-disposition: inline; filename=123.flv
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Keep-Alive: timeout=5, max=96
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: video/x-flv
>
> Can you please tell what I am missing here and/or is there anyway I
> can by-pass the mod_deflate compression?
>
> TIA.
>
> ---------------------------------------------------------------------
> 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
>
>