On Tue, 4 Jun 2002, Alvar Freude wrote:

> The last years I experimented a lot with gzipped output and wrote my own
> gzipping output function (but without chunked encoding :-) ). I realized a
> lot of bugs with some different browsers under some environments or
> situations. I found no remarks according this in your documentation, so
> perhaps you missed something? 
> (if I missed something, feel free to write ;-) )
> 
> So, e.g. I created a website with a big server generated flash movie (with
> Flash generator, mod_perl, Postgres; yep, Flash sucks!), and Netscape
> doesn't decompress the output, but claims to understand gzip. AARRGH!

NN4 for Windows does not decompress gzipped Flash. NN4 for Unix does.
But no one browser decompress gzipped response that is fetched via
Flash's loadVariables() and XML.load() functions.

> Also compressed output does not work on IE, if the request was POSTed (only
> tested with older version, I gess 4.0, of IE).

I did not know about IE4 and POSTs, at least I did not received mod_deflate
bug reports about it. I know two IE4 gzip bugs. They described in
http://sysoev.ru/mod_deflate/readme.html#browsers (sorry, Russian only).

> gzip compression is enabled when:
>    
>    - browser acceps gzip
>    - or browser is an Bugscape 4.x on X11 or Mac

All NN4.5+ say "Accept-Encoding: gzip". NN4.0x for Unix and PPC Mac do
not say but understand it but they too rare now so you can ignore them.

> but gzip is DISABLED when:
> 
>    - method is not GET:
>      at least on some versions of IE (4.x), compressed pages didn't work
>      together with POST!

I did not know this bug. I will check.

>    - every image/* content type needs no gzip (at least GIF and JPEG ...)
>    
>    - browser is not "compatible" and Content-Type is not text/html,
>      even if browser said that he understand gzip
>      At least Bugscape 4.x didn't decompress embedded objects like
>      flash movies

NN4 also does not undresatnd gzipped application/x-javascript and ext/css:
http://sysoev.ru/mod_deflate/readme.html#types

>                                        # Important: we change output
>                                        # according to this headers
>    $r->header_out('Vary', 'Accept-Encoding, User-Agent');

It's not good idea - it disables caching in MSIE.

>                                        # don't forget Content-Length!
>                                        # it enables keepalive and disables
>                                        # some Netscape bugs
>    $r->header_out('Content-Length', length(${ $out->{document} }));

I'm not sure that sending Content-Length with gzipped content is good
idea. MSIE understands chunked transfer and can keep alive connection.
For NN4 we should close connection.


Igor Sysoev
http://sysoev.ru

Reply via email to