Updating selfpopulatingcache example

30-Dec-2015 05:34

In this case mutating cached values directly will lead to inconsistent results.A cached exception will be rethrown every time the key is accessed.If we never did fly on that route it will ask all our friends.Of course this is very time consuming, so we first ask the cache, whether something for that flight route is already known, if not, we call the expensive operation.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.That’s why the expiry of an exception is typically shorter then the configured expiry time.

The value is still available in the cache as fallback if a loader exception occurs.I am thinking about using template configuration or page properties to decided on caching strategies.Another thing we have is a uuid to cache key mapping which plains the way for isolated cache flushing (based on a linked graph).Here is an example formulated as Java 8 lambda expression, which inserts a value and sets the expiry after 120 minutes: The loader actions may only depend on the input key parameter.

In case the load operation will yield an exception it may be passed on to the cache.Except for the exceptions caching described above everything will work as you will expect from a cache.

But, according to the source, "Bella really likes Tyler.… continue reading »

Read more