cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: Programmatic invalidation of cache
Date Fri, 10 May 2002 11:12:55 GMT
> -----Original Message-----
> From: Nick Airey [mailto:nick.airey@ihavemoved.com]
> Sent: Friday, May 10, 2002 1:00 PM
> To: cocoon-dev@xml.apache.org
> Subject: RE: Programmatic invalidation of cache
>
>
> Hello Carsten, sorry to resurrect a lonh dead thread, but I am about to
> implement this, and I would really appreciate a little more info about
> how to do it.
>
> Problem: I want to remove the cache of pipeline "user" under key "1".
> This code is going in an action class which runs on a different pipeline
> (not user), but which must invalidate the user pipeline, prompting the
> user pipeline to refresh itself from the database.
>
>
> So I first I need to get the store.
>
> Store store = (Store) manager.lookup(Store.TRANSIENT_CACHE);
>
> Is this the store for all pipelines? (and I must then get the "user"
> one), or is this the store for "user"? (if so, how does it decide to
> give me that one?)
>
Hi Nick,

the above store is used for the caching of all requests (and for other
purposes as well).

A response is stored inside the cache under a compound key. This key
is assembled by the different pipeline components (generator, transformers
etc).
The URI of the pipeline does not play a role in here!.

So, assuming a Pipeline with G->T1->T2->S and all four components cacheable
the key is build by getting the key from each component (G, T1, T2, S) and
then a string is build with exactly this information (see the
CachingStreamPipeline.java and CachingEventPipeline.java) for more
information.

So if you want to delete a cached response, you have to emulate this
creation
of the key, and remove the object stored under this key from the store.

But be warned that you use implementational details for this that might
change from one version of cocoon to another, so the building of the key
might be different in a future release.

Carsten

Carsten Ziegeler               S&N AG, Germany - Open Source Group
==================================================================
mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
==================================================================
The Cocoon Book:
http://www.amazon.com/exec/obidos/ASIN/0735712352/apachecocoona-20


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message