前言
SpringBoot使用通过原生AOP实现的Cache
Cache
为当前方法添加Cache
methodCache
:Cache名
1 2
| @Cacheable("methodCache") public void method(){}
|
启动清理缓存
value
:清理的Cache名
allEntries
:清理全部内容
beforeInvocation
:清理时间在方法执行前
1 2
| @CacheEvict(value = "methodCache", allEntries = true, beforeInvocation = true) public void method(){}
|
完成