cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "g[R]eK" <>
Subject Re: AW: How to make Generator cacheable?
Date Sun, 15 Jan 2006 21:00:40 GMT
Christian Barth napisaƂ(a):
> The caching is working now with the following code
> <snip/>
> But as you can see, The Cache expires after 5 minutes. What I want is, that
> is gets invalid, when the LastModificationDate of my DB has changed.
> In the getKey()-Method I have already searialized the timestamp of the last
> modification, But now I don't know how to test, if the Cache is still valid
> in the getValidity()-Method.
> Can anybody help?
I think you confuse things about caching. The key of cache should not be 
a timestamp. The key is unique identifier of your particular 
configuration (e.g. your database url), and validity object contains 
information needed to check if entry with particular key is still valid. 
In your case, you can return whatever you want in your getKey() method 
(if you have only i configuration). The getValidity() should return 

Check [2] for further information. Hope this helps.


View raw message