Updating selfpopulatingcache example
This variant is the better choice if outdated values are allowed to be visible in the event of a temporary failure.
An inconsistency is only allowed when a temporary failure occurs.
After some time passes, the loader will be called again.
A cached exception can be spotted by the expiry time in the exception text, for example: Cached exceptions can be misleading, because you may see 100 exceptions in your log, but only one was generated from the loader.
How exceptions are handled by the cache is defined by the resilience policy and explained in the Resilience chapter.
The information of the current entry can be used to optimize the data request.
The cache uses the key instance in its own data structure.This means mutating a value, will affect the cache contents directly.Future versions of cache2k will have additional storage options and allow cache entries to be migrated to off heap storage or persisted.Interfaces not meant for extension may get new methods.The documentation is intended as a overview guide through the functionality of cache2k and will help you discover every important feature.
Search for updating selfpopulatingcache example:
A typical example is the optimization of HTTP requests.