Spring Boot 自动配置原理
原创小于 1 分钟
本篇文章将介绍如何使用 Redis 作为数据源,实现 Spring Boot 的方法缓存。
要实现方法缓存,首先需要引入 spring-boot-starter-cache
和 spring-boot-starter-data-redis
这两个依赖。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>