Does ehCache have any feature of auto refreshing? If yes, please let me know how to do that. If not, please let me know few possible and efficient ways in which ehCache refresh can be done.
There is no way for EhCache to know how the data that was inserted into to it, was produced. That part is totally application specific. There fore EhCache cannot refresh itself automatically- it can't pull the data, the data has to be pushed into it.
In order to do that you need to add another component to your application that will run at a scheduled time and while insert the appropriate data into EhCache.
Spring has awesome support for scheduled tasks. Check out this part of the documentation
ehCache has builtin eviction algorithms that you can use by setting timeToIdleSeconds and timetoLiveSeconds this will tell ehcache when to eject that data from the cache and force a reload of the data from your persistence data source. Read the following ehCache document on more detailed instruction on configuring TTL http://ehcache.org/documentation/configuration/data-life
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With