原文:https://www.cnblogs.com/superfj/p/9232482.html
选择redis作为默认缓存工具
boot1.x
@Bean
public CacheManager cacheManager(RedisTemplate redisTemplate) {
RedisCacheManager rcm = new RedisCacheManager(redisTemplate);
return rcm;
}
boot2.x
@Bean
public CacheManager cacheManager(RedisConnectionFactory connectionFactory) {
RedisCacheManager rcm = RedisCacheManager.create(connectionFactory);
return rcm;
}