[Catalyst] Re: modules for conditional GET ?

Dami Laurent (PJ) laurent.dami at justice.ge.ch
Mon Jan 18 07:35:43 GMT 2010


 

>-----Message d'origine-----
>De : Aristotle Pagaltzis [mailto:pagaltzis at gmx.de] 
>Envoyé : samedi, 16. janvier 2010 15:34
>À : catalyst at lists.scsys.co.uk
>Objet : [Catalyst] Re: modules for conditional GET ?
>
>* Dami Laurent (PJ) <laurent.dami at justice.ge.ch> [2010-01-14 16:05]:
>> For some actions of a Catalyst app, I would like to implement
>> conditional GET (using If-Modified-Since HTTP header), where
>> the timestamp of one config file decides whether the page
>> should be refreshed or not  --- this is because that page is
>> quite expensive to compute.
>
>I agree with the others who have responded, but they didn't
>explain why theirs was the right answer, so:
>
>You're not checking whether any state has changed since the
>last GET to decide whether to recompute. That is the case in
>which conditional GET would be appropriate. That would allow
>you to avoid recomputing the page indefinitely as long as no
>state changes necessitate it, but it requires that the clients
>keep asking.
>

Indeed, this is exactly what I want to do. The app has a config file (not a Catalyst
config file, but another file having to do with business logic), and some super-users
have a mechanism for hot uploading of a new config to the server, at any time. 
A few app pages are expensive to compute, and they depend on the client and on that config file. So clients should keep asking for those pages at each request, and depending on the If-Modified-Since header and on the timestamp for the config file, the server can decide if it's worth recomputing the page for that client, or rather send a cheap 304 Not Modified.

Cheers, L. Dami



More information about the Catalyst mailing list