[Catalyst] A suitable method to redraw a page
Tomas Doran
bobtfish at bobtfish.net
Wed Sep 24 09:19:34 BST 2008
On 24 Sep 2008, at 00:30, Dermot wrote:
> 2008/9/23 Mesdaq, Ali <amesdaq at websense.com>:
>
>> I think ajax would be your friend here.
>
> I think I'll try something like that. As the files and Cat App are on
> one server and the referrer is a different server, I will have the
> referrer call a local script and fire a request from there.
Are you sure that you actually want your web server running this
script? It may not be an issue for you, but if this needs to be
scalable then I'd highly recommend using a distributed job queue such
as TheSchwartz.. This also buys you other architectural benefits as
you've done a load of decoupling, so you can now trivially have
command line admin tools which monitor jobs in progress etc...
If you take this approach, you don't have a problem, your first hit
does a POST which submits a job (quick), then redirects the user to a
page which refreshes regularly that reports on the job status, and
once the job is complete, the next refresh can display a different
page / redirect the user again as appropriate.
Also, you don't need no steenkin Javascipt (although you're free to
use it to improve the user experience, you have graceful
degredation), and you've got a system that can trivially be
abstracted to handle running / reporting status on a whole multitude
of jobs...
Cheers
t0m
More information about the Catalyst
mailing list