Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Mason: Please Wait While Generating

by water (Deacon)
on Jul 20, 2005 at 21:45 UTC ( [id://476628]=note: print w/replies, xml ) Need Help??


in reply to Re: Mason: Please Wait While Generating
in thread Mason: Please Wait While Generating

Thanks, cowboy, this looks great.

I don't follow all of it, though.

Is there an automatic redirect to the finished page? Or is the user just instructed to hit refresh after waiting a bit on the building_page component?

thanks

water

  • Comment on Re^2: Mason: Please Wait While Generating

Replies are listed 'Best First'.
Re^3: Mason: Please Wait While Generating
by cowboy (Friar) on Jul 21, 2005 at 16:28 UTC

    I basically print out a very light 'Loading' type page, which has a meta-refresh tag to tell the client to re-request it in a few seconds.

    If it has completed whatever work it needs to do (in my case, execute a heavy database query and collect results, then cache them), it then displays the results (which are now in the cache), if it hasn't completed it, it spits up the 'Loading' page again, set to refresh again.

    (update:) The basic logic is as follows:
    if (page_is_in_cache) { display page. } elsif (flag_is_in_cache) { page is being rendered, display a 'loading' message with a meta refr +esh } else { set_flag_in_cache display loading page render page stuff page in cache clear flag in cache }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://476628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found