spring boot 整合redis 缓存 Cacheable
·
1. 链接redis
spring boot 默认关闭redis链接,安装redis并配置链接:application.yml
2. 引入缓存jar包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
3.在需要缓存的位置 添加注解 @Cacheable

4. 缓存注解@Cacheable、@CacheEvict、@CachePut详解
参考地址:[https://blog.csdn.net/newbie_907486852/article/details/81478046]
更多推荐
所有评论(0)