Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get unbuffered CGI output to browser

Status
Not open for further replies.

NHunt

Technical User
Dec 30, 2001
3
US
Using Apache 1.3.22 with Perl CGI on Win2k.

I'm trying to get a "Processing, please wait" message
to appear, and then be replaced by the result 20 seconds later.
I can't assume Javascript.

I planned to send a partial page with the "please wait"
message in a named div, flush the output to the browser,
and then follow up with javascript to empty the named div
(if no javascript, the message remains -- too bad),
and finally the result HTML.

Problem is, nothing gets sent to the browser until the
entire processing is done.

My CGI script is definitively flushing the HTML.
I can run it standalone and watch the initial output,
then after the sleep(10) I added to simulate processing
the final output appears.

Also, I've examined the output from apache using telnet,
and I see the whole chunk appear in one go after the
10 second delay --
so it clearly isn't a problem with the browser not
interpreting partial HTML either.

I've searched manuals and forums, and all the doc seems
to imply that output is not buffered. But it certainly
seems that way to me. I've played with adding
a correct Content-length header, so that the content-length
filter doesn't have to count for me.
I've played with NPH headers, but I can't figure out
how to make the CGI script run in NPH mode (the doc
describes how to make a file download "asis", but
its not a file I'm running...)

Any ideas?
 
What about redirection meta tag in html?

You would send the page with message and that tag which will than redirect user to the new page which would be avaiable only after that 10 seconds (CGI).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top