XP is just a number | |
PerlMonks |
Re: CGI, fork, long processes on Apache 2by Vautrin (Hermit) |
on Apr 03, 2004 at 18:06 UTC ( [id://342328]=note: print w/replies, xml ) | Need Help?? |
The code you provided isn't very helpful. Are you saying that the script itself fails, or that the script works in the background, and the web page won't refresh? There is a big difference, and there are very different answers to each question. I'd bet that what you're talking about is that the web page isn't refreshing since it is browser specific. If this is the case, you need to check how you're making the page refresh. Are you using a refresh header, a META refresh tag, or javascript? The best thing to do is javascript, because IIRC some browsers don't refresh until the page completely loads. The problem with this is that there are known issues with forked long running cgi scripts under Apache 2.0.x, that mean that the web page will never load. What you should do is create a tag just like this in your web page:
Because javascript is loaded before the web page finishes loading, it should work well. And you should have it point to a web page with a META refresh tag, or refresh header, or create a javascript script to refresh at the proper interval. Also, always keep a refresh tag / header in the first page you send out -- just in case the client has javascript turned off. Also, if you want to save on server load, it is possible to write a javascript script to fetch a number (percent complete), display it, and then post the results when everything is done. I know creating a page that refreshes in Perl might be easier, but if you have a very high server load it can save you significant bandwidth (just sending 2 - 3 bytes in charachters for the percent done versus entire web pages) Hope that helps, Vautrin Want to support the EFF and FSF by buying cool stuff? Click here.
In Section
Seekers of Perl Wisdom
|
|