上文 spring boot整合 cache 以redis服务 处理数据缓存 便捷开发 我们写了个整合缓存的基本功能
但 其实我也因为很多时候redis服务没起 等等原因 导致缓存功能整个用不了
其实 最简单的就是 将redis相关配置去掉

不过为了方便 我们可以这样
application.yml文件中这样写

spring:
  cache:
    type: simple

这里 就是设置了 我们cache缓存用 simple 默认

当然 如果你就要 redis 的就是

spring:
  cache:
    type: redis

不要太简单

02-12 07:09