Operating System - HP-UX
1834127 Members
2260 Online
110064 Solutions
New Discussion

How do I prevent a browse timing out while a script runs?

 
Ed Duffner
Occasional Advisor

How do I prevent a browse timing out while a script runs?

Hi,

I have a cgi script (HP-UX K-shell) that performs database activities but sometimes it takes so long because of the amount of data being processed, the browser times out, or perhaps it's the web server.

Can I send anything back from my shell script to 'keep alive' the browser?

I do not want to increase the time out period of the web server.

Thanks,
Ed.
4 REPLIES 4
James Beamish-White
Trusted Contributor

Re: How do I prevent a browse timing out while a script runs?

I would suggest changing your CGI script or database layout to reduce the amount of data being returned/searched. From a design perspective, if a user has to wait more than 7-10 seconds, it is likely they will get fed up and go to a different site.

Just my 2c :-)

James
GARDENOFEDEN> create light
Sridhar Bhaskarla
Honored Contributor

Re: How do I prevent a browse timing out while a script runs?

Ed,

One way that I can think of is to modify your cgi to print a "refresh" page while executing the cgi in back ground that prepares the result document.

For ex your initial cgi should take care of the following to be printed while keeping the original cgi in background to prepare result.html.





<meta http-equiv="refresh" content="10;URL=result.htm" />

Please wait...



After 10 seconds, it is going to display result.html that was created by the cgi in background. You can even use a cgi script here to check if the result.html is completed. Else you can print the same refresh html again

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
harry d brown jr
Honored Contributor

Re: How do I prevent a browse timing out while a script runs?

If you are using older versions of MS environments (95, 97, 98) IE will timeout, and force a new connection after two minutes, so I hope you are using NS or a newer version of MS. To overcome this, use Sridhar's "refresh" option.
Live Free or Die
Ed Duffner
Occasional Advisor

Re: How do I prevent a browse timing out while a script runs?

Thanks Everyone for the suggestions.

Sridhar, your idea sounds like it's just what I was looking for.

My Script is actually an admin tool and so won't be used by users 'general public' as such.

Thanks again,
Ed.