An error occurred while fetching the assigned iteration of the selected issue.
VmCache should support expireAfterWrite
Current VM Cache implementation sets expiry to expireAfterAccess
.
public VmCache(int cacheExpirationSeconds, int maximumCacheSize) {
this.cache = CacheBuilder.newBuilder().expireAfterAccess(cacheExpirationSeconds, TimeUnit.SECONDS)
.maximumSize(maximumCacheSize).build();
}
For systems that have frequent READ
calls, the cache expiration gets prolonged. And since there is no cache invalidation in place currently, stale data might never get updated.
Ask
Provide an additional constructor that could set expiration strategy
based on the need. To avoid breaking change, we could use the existing constructor as default setting.
This could enable devs to customize the expiration strategy and use expireAfterWrite
setting that would invalidate the cache entry as soon as the expiry time is reached.