cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arjé Cahn <>
Subject RE: Backend cache invalidation
Date Fri, 23 May 2003 14:10:29 GMT

We're using a validity registry that holds a key/value pair for each object to be cached.
The generator checks the registry: is the object still valid or should I fetch an update?
1) not in the registry -> go get it, set value to true
2) in the registry, value = false -> go get it, set value to true
3) in the registry, value = true -> return cached 

This is a pull-mechanism to fetch objects from your database. PUSHing them into the cache
(what you suggest) might be a bit more difficult.


> -----Original Message-----
> From: Hunsberger, Peter []
> Posted At: 23 May 2003 15:43
> Posted To: Cocoon Dev List
> Conversation: Backend cache invalidation
> Subject: Backend cache invalidation
> It seems to me that this must be a classic Cocoon problem, 
> but I really
> haven't found any discussion of it or how to solve it:
> We have a generator that creates some content (from a 
> database via EJBs)
> that for 99.99% of the time is unchanging.  Every once and a 
> while an end
> user (with admin rights) will make a change to this content 
> and immediately
> expect all users to be able to see the changes upon a 
> subsequent refresh of
> the relevant screen.  The content is expensive to generate 
> and it makes
> sense to cache it.  We could in fact cache it once and for 
> ever if we didn't
> have the occasional update.
> Is there currently any way to have the back end signal to 
> Cocoon that a
> particular cache item needs to be invalidated?  We're 
> thinking of building a
> MX Bean listener that would register itself with a common 
> proxy super class
> for all EJBs.  Then upon successful insert or update on the 
> back end the
> proxy classes would signal the listener to blow away the 
> particular cache
> entry.  Essentially this would be something like a
> BackEndListenerCacheValidty (or BackEndCheckingCacheValidity 
> although it
> doesn't really check) class.  Does this make sense? Does 
> Cocoon or anyone
> have anything like this already?
> Peter Hunsberger
> <Debating on whether to unleash the following Russell quote on the
> world.../>
> The infliction of cruelty with a good conscience is a delight 
> to moralists -
> that is why they invented hell.
> Bertrand Russell (1872 - 1970)

View raw message