rediscache专题

RedisCache存入redis的数据key为何name和id的分隔符是两个冒号::

Redis Cache缓存数据生成的key是由两部分组成,cacheNames和+d或者自定义生成方案,如果采用cacheNames+id方案则会在中间添加两个冒号::,这样使用工具查看的时候感觉怪怪的,今天我们就探讨下具体生成原因。 一、CacheKeyPrefix钩子回调接口 @FunctionalInterfacepublic interface CacheKeyPrefix {

在SpringBoot项目中应用RedisCache功能

1.application.yaml中添加cache配置 spring:cache:type: redisredis:time-to-live: 72000000key-prefix: 'redis:cache:'use-key-prefix: truecache-null-values: true 2.封装RedisCache配置类 @EnableConfigurationProperti