提交 92f69970 编写于 作者: 程序猿小亮's avatar 程序猿小亮

添加注释

上级 e5f932db
......@@ -12,10 +12,12 @@
<artifactId>springboot-cache</artifactId>
<dependencies>
<!--引入缓存场景-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<!--使用redis作为缓存中间件-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
......@@ -27,7 +29,6 @@
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
......
......@@ -21,9 +21,9 @@ import org.springframework.data.redis.serializer.*;
* @DATE: 2021-07-01 15:02
*/
@EnableConfigurationProperties(CacheProperties.class)
@EnableConfigurationProperties(CacheProperties.class) //开启属性配置绑定功能
@Configuration
@EnableCaching
@EnableCaching //开启缓存启动类的注解从启动类移到这里
public class CacheConfig {
......
......@@ -37,7 +37,7 @@ spring:
redis:
#是否缓存空值,防止缓存穿透
cache-null-values: true
#缓存过期时间
#缓存过期时间(单位为毫秒)
time-to-live: 100000
#缓存前缀,用于区分其他缓存,不指定前缀,默认使用缓存的名字作为前缀
# key-prefix: CACHE_
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册