I would like to refresh the cache everyday 12am or the cache expired at 12am. I had check the available methods in net.sf.ehcache.config.CacheConfiguration, but these methods i.e. timeToIdleSeconds, timeToLiveSeconds seem like not what I want. May I know how to achieve this?
Edit 1:
Here is how I use @Cacheable.
@Override
@Cacheable(value = "cacheName")
public Object retrieveConfigurations() {
...
}
You can use @Scheduled:
@Scheduled(cron = "<cron expression>")
@CacheEvict(value = "<cache name>")
public void clearCache() {
}
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