How do I disable output buffering in CGI scripts so the browser prints text as it’s available (as opposed to waiting for all text output then rendering it all in one shot) ?
I currently have this in my code:
… which works on other hosting providers. But it doesn’t work on my dreamhost account on the greengoblin server. I initially thought it was a problem with the mod_deflate module since that’s known to buffer all output first, but I had a support rep turn that off for my account but it didn’t help.
Anyone have any other tricks to make this work?
Take this example:
print “Content-type: text/plain\n\n” ;
print “I was here\n” ;
sleep 3 ;
print “I was here again…\n” ;
… If this were written as a CGI script, it should print the first line of text (“I was here\n”), then sleep 3 seconds, and then render the second line of text (“I was here again…\n”)
In fact, here are two URL’s to test:
One hosting provider where the output buffering works as expected:
Here at dreamhost, where output buffering is turned on:
This works for me on other hosting providers, but not here at Dreamhost, and I’m not sure what else to ask support to try. (Daniel J, the support rep helping me didn’t know what else to try either).