perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Sysoev ...@rambler-co.ru>
Subject Re: "Streaming" compression of output from mod_perl handler?
Date Wed, 20 Feb 2002 15:01:42 GMT
On Wed, 20 Feb 2002, [iso-8859-1] Nicholas OxhЬj wrote:

> > Sorry again. I've just checked sources and found that if mod_deflate
> > received flush then it flushes both zlib and Apache.
> > 
> > You can try to set autoflush in perl module with $|=1;
> > or call $r->rflush; when you like to flush output.
> 
> I just tried using $r->rflush in my handler and it works perfectly :-)
> The output gets rendered on the fly and it barely hurts the compression ratio. The 430
KB gets compressed to 26 KB instead of 24.5 KB :-) :-)

What browsers did you test ?

> But wouldn't it be nice to have some mod_deflate option where you could specify that
mod_deflate should flush and send the currently compressed output every time it had received
a certain amount of input or every time it had generated a certain amount of output.

It's complicates things.
Besides Apache never flushes output on timeout or amount of content -
it flushes only if you ask it.

> We are, for instance, using a template module to generate the output. We just give the
template module a data structure and a template, and it then goes away and fills in the template,
outputting HTML. This means that we don't have any easy way of calling flush at certain So
we don't have any easy way of calling rflush once in a while.
> Of course we might just modify or substitute the template module, but it seems like a
more "automatic" kind of "streaming" deflating (like described above) would be nice to have.

You can set $|=1 as Eagle book says:

This method [r->flush()] is also called automatically after each
print() if the Perl global variable $| is nonzero. 

Igor Sysoev


Mime
View raw message