
配置示例
#缓存配置
cache:
  #启用缓存，启用缓存后必然需要启动eh或redis缓存之一；
  enabled: true
  #启用ehcache缓存
  ehcache-enabled: true
  ehcache-share: true
  #启用redis缓存
  redis-enabled: true
  #设置redis缓存更新时通知其他节点的topic名称，默认"cache:auto:topic"
  topic: cache:auto:topic
  #设置开启多级缓存，默认开启
  second-level: true
  #存储空值，是否允许空值存储
  null-value: true
  #全局过期时间，默认为0，不过期
  expire: 0
  #开启随机过期时间，若设置,则过期时间不小于全局过期时间
  random-expire: false
  #缓存对象是否可动态创建标识，默认为开启；若不开启，当没有缓存对象时将缓存失败
  dynamic: true
  #所有缓存公用静态缓存名称，数组
  cache-names:
    - test1
  #eh配置文件路径 ,默认在类路径：default_ehcache.xml
  ehcache-config: default_ehcache.xml
  #eh静态缓存名称
  ehcache-cache-names:
    - test2

#redis配置，参见springboot redis配置即可
#示例
spring:
  redis:
    host: host


使用示例：
    方式1：使用springboot的注解方式使用，参考springboot cache使用
    方式2：使用ioc注入的方式，将缓存服务类注入即可，具体可注入服务类参见：service.impl包下