software development


I have some pages that are slow to load. I’d like to return a message immediately for the user to wait, and then return the rest of the page once it is ready.

I’ve tried a number of techniques, including this (which worked on my old host):

$old_fh = select(STDOUT);
$| = 1;

Nothing is working. Please advise on how to get this to work. Thanks.

– Scott


I have always thought the function flush was intended for this purpose, but I have never had to rely on it, so I’m not sure if it will help you or not.

Sorry I can’t provide a more complete response, but that’s what I know!


Thx, but I should have specified, I’m doing this in PERL, not PHP. I tried your suggestion, but PERL doesn’t recognize “flush” on its own.

I have also tried:

$old_fh = select(STDOUT);
$| = 1;

Again with no luck.

I think it may be some kind of configuration issue?

– Scott


Here’s something I found discussing this as a bug with Apache 2. I don’t quite follow it, other than it does appear to be an Apache bug…


– Scott


Hmm, but of course DreamHost is not running Apache 2.

Problem need to look elsewhere for the bottleneck - server load, perhaps? A lot of libraries/modules? Have you tried putting the flush in a BEGIN block?

:cool: Perl / MySQL / HTML+CSS