timwi wrote in httpd

Forcing Apache to send data to client

Hello,

I've written a web application in Perl (using mod_perl), and it's working quite OK thus far, but it's slower than it should be, because Apache delays the sending of data to the client until the very end of my script.

Is there an option to turn that off?

Here's some example code that I used to test this:
sub handler
{
    my $r = shift;
    $r->content_type ("text/plain; charset=utf-8");
    $r->send_http_header ();
    print ("Line 1\n\n");
    sleep (1);
    print ("Line 2\n\n");
    sleep (1);
    print ("Line 3\n\n");
    sleep (1);
    return OK;
}
Then I telnet the server and send the request by hand. What should happen is that I see the three lines appear in progression. What does happen is that it does nothing for three seconds, and only then sends everything.

So, is there a way to tell it to send response headers and data immediately?

Thanks in advance!