我SSMCache
用来在我的应用程序中存储一些对象。我正在将SSMCache
对象添加到我CacheManager
的下面:
@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;
}
我想知道如何不指定缓存过期时间以使我的缓存始终可用,即。我根本不希望我的缓存过期。
我浏览了官方文档,Simple Spring Memcached
但找不到有关如何指定非过期缓存的值的信息。
我认为使用值0
将使缓存根本不会过期,但我只想从指定它的文档或 wiki 中确定。我也浏览了构造函数,SSMCache
但找不到没有过期参数的构造函数。
请帮助我如何创建没有过期时间的缓存。