如何删除缓存中的条目

时间:2019-07-04 15:00:04

标签: java spring spring-cache

我正在使用Spring缓存。如果要在适当的时候满足特定条件,我想删除缓存中的单个条目。

Unit

}

如果满足if语句中的条件,如何从客户对象中删除客户对象?

1 个答案:

答案 0 :(得分:1)

首先,看看RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Check and ignore if the requested path is /install/ RewriteCond %{REQUEST_URI} !^/install(/|$) RewriteRule . index.php [L] 批注:

https://docs.spring.io/spring/docs/5.1.7.RELEASE/spring-framework-reference/integration.html#cache-annotations-evict

然后,看看“ 条件”缓存:

https://docs.spring.io/spring/docs/5.1.7.RELEASE/spring-framework-reference/integration.html#cache-annotations-cacheable-condition

@CacheEvict@CacheEvict具有许多相同的属性:

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/cache/annotation/CacheEvict.html

希望这会有所帮助!