Link to home
Start Free TrialLog in
Avatar of serg111
serg111

asked on

CGI takes too long

#!/usr/bin/perl

OutputPage();
AnalizeResult();
exit;

This script above shows web page with delay 40 sec since function AnalizeResult() takes 40 sec to return. How can force page to be shown immediately after OutputPage() and then run AnalizeResult()?
Avatar of Chris S
Chris S
Flag of India image

try

$|++;

use CGI;

$q = new CGI;

print $q->header;

OutputPage();
AnalizeResult();
exit;



.. doesn't help much when the sever times out before AnalizeResult() has completed.

You eithetr need to tell the web server's admin to increase the timeout (which s/he will not do, usually), or print a page which refreshes after a few seconds, while your CGI writes to a file.
Avatar of serg111
serg111

ASKER

It doesn't work for me too :-(
Timeout is now 60 sec , so no sence to increase

and when I refresh page like this:
print "Location: http://www.server.com/M_BANNER.GIF\n\n";
It still takes 40 sec for file to load
> .. It still takes 40 sec for file to load
hmm, bad designed page ;-)
Anyway, if it is an image it should be cached by the browser, so should not be read again after a reload.
Did you write your refresh in the META tags of the html HEADer ?
ASKER CERTIFIED SOLUTION
Avatar of nickjc
nickjc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial