写在前面:
继续记录自己的SpringBoot学习之旅,这次是SpringBoot应用相关知识学习记录。若看不懂则建议先看前几篇博客,详细代码可在我的Gitee仓库SpringBoot克隆下载学习使用!
注:在上文项目里更改
net.sf.ehcache ehcache
# 配置cache使用技术
spring:cache: type: ehcacheehcache:config:ehcache.xml
ehcache.xml文件内容如下:
org.springframework.boot spring-boot-starter-data-redis
spring:# 使用redis缓存技术 cache: type: redis redis: use-key-prefix: true key-prefix: cache_ time-to-live: 5s redis: host: localhost port: 6379
注:其它类似上文