1.application.properties中记得启用缓存 spring.cache.type=redis
解决 springboot 中 @Cacheable不起作用

2.缓存的对象必须实现Serializable
解决 springboot 中 @Cacheable不起作用

3.SpringBootApplication中要加@EnableCaching注解

解决 springboot 中 @Cacheable不起作用

[email protected]是基于Spring AOP代理类,内部方法调用是不走代理的,@Cacheable是不起作用的

解决 springboot 中 @Cacheable不起作用

相关文章:

  • 2022-12-23
  • 2021-10-26
  • 2022-02-16
  • 2022-12-23
  • 2021-07-21
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2021-04-11
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
相关资源
相似解决方案