I'm trying to further my understanding of the caffeine cache. I was wondering if there is a way to specify a timeout for an entry that's populated in the cache, but have no time based expiry for the rest of the records.
Essentially I would like to have the following interface:
put(key, value, timeToExpiry)
// enter a key and value with a specified timeToExpiry
put(key, value)
// enter a key value with no timeToExpiry
I can write the interfaces and plumbing, but I'd like to understand how I can configure caffeine for both of the above requirements. I'm also open to have two separate instances of the caffeine cache.
put(key,value, timeToExpiry)
, where you specify the time to expiry when you are putting the value in the cache? – Gavrah