Sam Tregar wrote:

On Wed, 7 Jul 2004, Alex Mikhajlichenko wrote:
Did you made some additional tuning your script or your web server to
avoid a buffering?

No, I didn't. But I'm running under mod_perl which turns each print into a $r->print() call. I'm sure there's some buffering going on, but not enough to effect what I'm doing.


Under mod_perl you can flush the buffer manually by occasionally calling $r->rflush. works wonders in longer-running scripts.
I get the Apache Request object in my instance script:


#!/usr/bin/perl
use My::App; # my CGI::Application

$r = shift;
$app = new My::App( PARAMS => { r => $r });
$app->run;

### elsewhere in My::App
sub runmode {
        my $self = shift;
        # do work, print headers, etc.
        $self->param('r')->rflush;
        # more work
        #...
}

I've tried repeat your example. When I started it from console, it
works ok; it prints incremental result step by step.  But when I
started it from browser, it still waits and returns result all as
whole.

That's odd. Maybe try putting some newlines in the output?

I've repeatedly run into this issue as well, mostly with Internet Explorer. It seems IE wants a certain amount of data before actually displaying anything. Most of the time I was able to force IE to display by using an initial output of


print $self->query->header(),
      $self->query->start_html(), $/;

but that only works for html output. The best you can do is make sure you start off with a reasonably sized chunk of data.

Hope this helps,

Rhesa Rozendaal



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to