I am using SSMCache
to store some objects in my application. I am adding the SSMCache
object to my CacheManager
like below :
@Bean
@Override
public CacheManager cacheManager() {
Set<SSMCache> ssmCacheSet = new HashSet<>();
try {
ssmCacheSet.add(new SSMCache(getMyCache(),
PropertyManager.getIntProperty("memcached.interval", 14400), true));
} catch (Exception e) {
LOGGER.error("Error creating cache manager", e);
}
SSMCacheManager ssmCacheManager = new SSMCacheManager();
ssmCacheManager.setCaches(ssmCacheSet);
return ssmCacheManager;
}
I want to know how to NOT specify the cache expiration time in order to make my cache available at all times ie. I do not want my cache to expire at all.
I went through the official documentation for Simple Spring Memcached
but could not find on how to specify the value for a non expiring cache.
I think using a value of 0
will make the cache not expire at all, but I just want to make sure from a documentation or wiki where it is specified. Also I went through the constructors of SSMCache
and could not find one which does not have expiration parameter.
Please help me on how to create the cache without an expiration time.
Did you check the source code in Github repository. You can search "never expire" keyword in repository and you will get the files having lines like below. For example UpdateSingleCache.java has following detail in comments.