Python CGI and Browser timeout
Steve Holden
steve at holdenweb.com
Sat Apr 28 10:32:03 EDT 2007
Sebastian Bassi wrote:
> On 26 Apr 2007 14:48:29 -0700, skulka3 at gmail.com <skulka3 at gmail.com> wrote:
>> In order to work around this problem, I started printing empty strings
>> (i.e. print "") so that the browser does not timeout.
>
> How do you print something while doing the query and waiting for the results?
> I saw some pages that display something like: "This page will be
> updated in X seconds to show the results" (X is an estimated time
> depending of server load), after a JS countdown, it refresh itself and
> show the result or another "This page will be updated in X seconds to
> show the results".
The usual way is by "client pull": send the content you want the user to
see, and include a Refresh: header - the easiest way is to include a
META tag in the html content <head> section like
<meta http-equiv="refresh" content="N; URL=other-web-address">
So the page can continually check whether the user's job is finished, if
it isn't just sending out the same content and then when it is printing
the details.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get Python in your .sig and on the web. Blog and lens
holdenweb.blogspot.com squidoo.com/pythonology
tag items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------
More information about the Python-list
mailing list