You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Stas Bekman <sb...@stason.org> on 2000/04/12 22:58:47 UTC

[suggestion] *::GZip and chunked output

A few people have reported lately that they experience a problem with a
chunked output from *::Gzip filters. I think that using DESTROY to
Finalize Output technique as described at
http://perl.apache.org/guide/snippets.html#Using_DESTROY_to_Finalize_Output
will provide a nice workaround. 

If any of you have a few spare minutes, this can be solved on a global
level without changing a line in your original code (and making a nice
contribution to the mod_perl community :). Just write another
Apache::Filter like module, (let's call it Apache::Buffer) which will
buffer all the input and flush it using the above technique. So you'd use:

 <Files *.html>
   SetHandler perl-script
   PerlHandler Apache::OutputChain Apache::GzipChain \
                                   Apache::Buffer Apache::PassFile
 </Files>

This will solve two problems: 

1) chunked gzipped output 
2) will improve the compression as there will be more input to work on at
once for the GZip module.

What do you think?

______________________________________________________________________
Stas Bekman             | JAm_pH    --    Just Another mod_perl Hacker
http://stason.org/      | mod_perl Guide http://perl.apache.org/guide/ 
mailto:stas@stason.org  | http://perl.org    http://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
----------------------------------------------------------------------


Re: [suggestion] *::GZip and chunked output

Posted by Stas Bekman <sb...@stason.org>.
On Thu, 13 Apr 2000, Honza Pazdziora wrote:

> On Wed, Apr 12, 2000 at 10:58:47PM +0200, Stas Bekman wrote:
> > 
> >  <Files *.html>
> >    SetHandler perl-script
> >    PerlHandler Apache::OutputChain Apache::GzipChain \
> >                                    Apache::Buffer Apache::PassFile
> >  </Files>
> > 
> > This will solve two problems: 
> > 
> > 1) chunked gzipped output 
> > 2) will improve the compression as there will be more input to work on at
> > once for the GZip module.
> 
> I have a little mental problem: why doesn't NN understand the gzipped
> output being chunked? I mean, if the result is a correct gzip (isn't
> it?), why doesn't it process it correctly?

Heh, why do we have to program for each browser in a different way? and
many other similar questions... When mozilla will take the leadership back
I hope many questions will go away :) (...may be not)

> Otherwise, as this seems to be a problem of GzipChain only at the
> moment, I'll probably vote for Rick's patch or something similar being
> done on the Apache::OutputChain level.
> 
> But yes, something like Apache::BufferChain would certainly be usefull
> and I'll add this into the Apache::OutputChain distribution.

Ok, so you will add this one. Thanks!!!

______________________________________________________________________
Stas Bekman             | JAm_pH    --    Just Another mod_perl Hacker
http://stason.org/      | mod_perl Guide http://perl.apache.org/guide/ 
mailto:stas@stason.org  | http://perl.org    http://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
----------------------------------------------------------------------


Re: [suggestion] *::GZip and chunked output

Posted by Honza Pazdziora <ad...@informatics.muni.cz>.
On Wed, Apr 12, 2000 at 10:58:47PM +0200, Stas Bekman wrote:
> 
>  <Files *.html>
>    SetHandler perl-script
>    PerlHandler Apache::OutputChain Apache::GzipChain \
>                                    Apache::Buffer Apache::PassFile
>  </Files>
> 
> This will solve two problems: 
> 
> 1) chunked gzipped output 
> 2) will improve the compression as there will be more input to work on at
> once for the GZip module.

I have a little mental problem: why doesn't NN understand the gzipped
output being chunked? I mean, if the result is a correct gzip (isn't
it?), why doesn't it process it correctly?

Otherwise, as this seems to be a problem of GzipChain only at the
moment, I'll probably vote for Rick's patch or something similar being
done on the Apache::OutputChain level.

But yes, something like Apache::BufferChain would certainly be usefull
and I'll add this into the Apache::OutputChain distribution.

Yours,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
------------------------------------------------------------------------