I can't find an answer in the API docs, that's why I'd like to ask here:
Given I have a cache2k cache
Cache<String, Integer> cache =
and put an item in it
the expiry time of this item is one minute. After 30 seconds I update this item with
is the expiry time of this item now approximatly 30 second or one minute again?
Every helpful comment is very appreciated. Maybe I missed the answer in the docs or there is some standard I don't know about...
The expiry duration is the time between an entry is stored in the cache (e.g. via put or a get() and read through) until the entry is considered expired. Expired entries are no longer valid and not returned any more by the cache. Whether an expired entry is removed from the internal cache data depends on other configurations.
Some caches make a difference between the expiry time after a new entry and an update. In cache2k this is identical.
So, after the second put() the expiry is reset and the entry expires after one minute.