[Catalyst] Re: modules for conditional GET ?
pagaltzis at gmx.de
Sat Jan 16 14:34:02 GMT 2010
* 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
Instead you merely want to avoid doing any recomputation for
some predefined period of time, regardless of your state. This
is a case for caching: since you aren’t going to recompute the
page until said time has passed, you may as well tell the client
that it’s superfluous for them to try asking again before that
period is up.
Aristotle Pagaltzis // <http://plasmasturm.org/>
More information about the Catalyst