坑爹问题总结

一、springboot 整合 redis    @CacheEvict 注解失效 ,不能清空缓存

在使用Spring @CacheEvict注解的时候,要注意,如果类A的方法f()被标注了@Cacheable注解,那么当类A的其他方法,例如:f2(),去直接调用f()的时候,@Cacheable是不起作用的,原因是@Cacheable是基于Spring AOP代理类,f2()属于内部方法,直接调用f()时,是不走代理的。
原文地址:https://www.cnblogs.com/lufei33180/p/13172581.html