> -----Original Message----- > From: Nick Airey [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 10, 2002 1:00 PM > To: [EMAIL PROTECTED] > 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:[EMAIL PROTECTED] http://www.s-und-n.de ================================================================== The Cocoon Book: http://www.amazon.com/exec/obidos/ASIN/0735712352/apachecocoona-20 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]