Le 1 juin 04, � 10:09, Sylvain Wallez a �crit :

...Well, it _could_ have a chance to work, but flowscript is definitely not the appropriate location to compute cache information for an element of the view pipeline....

flowscript maybe not but how about backend java code?

Use-case: for a news site, you might want the cache validity to be dependent on the "urgency" of the news, for example cache older news for a longer time, assuming they won't change much anymore.

In this case the cache validity (or at least hints to the appropriate validity range) needs to come from the backend.

...So what about adding two optional attributes on the template's root element, defining the cache information?

<page
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";
jx:cache-key='${cocoon.request.get("abc") + "!!spacer!!" + cocoon.request.get("bcd")....'
jx:cache-validity='${new DeltaTimeCacheValidity(60 * 60 * 24)}'>
... template ....
</page>

I like the idea, and IIUC it would also allow the Flow to receive the DeltaTimeCacheValidity (for example) from your java code and pass it down to JXTG, right?


    jx:cache-validity='${someObjectComingFromJavaCodeViaFlow}'>

Or, in other words, do you see this as having access to any additional variables passed in the cocoon.sendPage call?

-Bertrand



Reply via email to