1

在 Spring Web 项目中,如果我们使用单个缓存服务器和不同的缓存管理器,例如注解是

@Cacheable(value = "configCache", key="#key")
@Cacheable(value = "envCache", key="#key")
...

如果我们这样做

@CacheEvict(value = "configCache", allEntries=true) 

如果我们allowClear=true在配置中启用,那么这只会驱逐configCache? 或者它也会清除envCache

我们已经看到在 Amazon ElasticCache 中执行了许多 flush_all 命令,并且大部分项目都被回收了。这是因为我们使用了 evict allEntries 吗?

4

1 回答 1

1

如果envCache 与 configCache位于同一 memcached 实例/服务器上,则If 也会清除它。因为 memcached 不支持命名空间,所以只能从实例中删除所有键。

于 2016-09-29T08:42:08.830 回答