[Opensymphony-oscache] Cache eviction after expiration

garu <[email protected]> Wed, 20 Jul 2005 03:11:41 CDT
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <24613310.1121847247337.JavaMail.os-j2ee@opensymphony01.contegix.com>
Hi all, i have the following scenario:
a frontend application that presents dynamic data taken via http requests from a backend application.
I'm caching the backend answers for 1 minute, then cached data must be refreshed.
If for any reason the backend application does not respond, i need that the cached data are still used for 5 minutes after their expiration, after which they must be considered no longer valid and evicted from the cache.

This conflicts with the current cache behaviour:
1) the element expires
2) the first access gets NeedsRefreshException 
3) the process to refresh the cached element is started
4) in the meanwhile all the other accesses get the expired cached element
5) the refresh fails, goto step 2

This means that until i'm not able to refresh the expired cached element i'll continue to get it well beyond it's validity time range.

I've not been able to find a way to tell the cache that after a certain time a cached element is expired it must be cleaned from the cache or at least it must not be used any longer.

Can anybody suggest a solution to this?

Thanks,  Gabriele

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=4495&messageID=10975#10975