提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
前言
一、SpringCache是什么?
springCache 是spring提供快速生成缓存的注解配置
1.使用springCache需要引入springcache的依赖包
<!-- spring cache 快速缓存 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> <version>2.3.9.RELEASE</version> </dependency>
我们要将缓存的数据放到redis中,所以还需要引入redis的依赖包
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <v