https://www.ehcache.org/documentation/2.7/apis/cache-loaders.html
https://www.educative.io/collection/page/5668639101419520/5649050225344512/5643440998055936
https://stackoverflow.com/questions/32214191/eagerly-repopulate-ehcache-instead-of-waiting-for-a-read
Eagerly repopulate EhCache instead of waiting for a read
http://ww1.terracotta.org/documentation/4.1/bigmemorymax/api/refresh-ahead
https://www.educative.io/collection/page/5668639101419520/5649050225344512/5643440998055936
EhCache: refresh ahead
A cache decorator which implements read ahead refreshing. Read ahead occurs when a cache entry is accessed prior to its expiration, and triggers a reload of the value in the background.
A significant attempt is made to ensure only one node of the cache works on a specific key at a time. There is no guarantee that every triggered refresh ahead case will be processed. As the maximum number of backlog entries is reached, refresh ahead requests will be dropped silently.
A significant attempt is made to ensure only one node of the cache works on a specific key at a time. There is no guarantee that every triggered refresh ahead case will be processed. As the maximum number of backlog entries is reached, refresh ahead requests will be dropped silently.
Eagerly repopulate EhCache instead of waiting for a read
You will need two things in order to make this work with Ehcache:
- Use a cache loader - that is move to a cache read-through pattern. This is required as otherwise Ehcache has no idea how to get to the data mapped to a key.
- Configure scheduled refresh - this works by launching a quartz scheduler instance.