代码拉取完成,页面将自动刷新
此为 spring boot2 版本!! 如下即可使用j2cache缓存方法
@Autowired
private CacheChannel cacheChannel;
在application.properties中支持指定j2cache配置文件,让你开发环境和生产环境分离
j2cache.config-location=/j2cache-${spring.profiles.active}.properties
如下两项配置在application.properties,可以开启对spring cahce的支持
j2cache.open-spring-cache=true
spring.cache.type=GENERIC
如下两项配置在application.properties,可以设置spring cache是否缓存null值,默认是true
j2cache.allow-null-values=true
如下配置在application.properties,可以选择缓存清除的模式
j2cache.cache-clean-mode=passive
在j2cache.properties中配置,可以使用springRedis进行广播通知缓失效
j2cache.broadcast = net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy
在j2cache.properties中配置,使用springRedis替换二级缓存
j2cache.L2.provider_class = net.oschina.j2cache.cache.support.redis.SpringRedisProvider
j2cache.L2.config_section = redis (如果要使用lettuce客户端请配置为lettuce)
在application.properties中支持redis客户端
j2cache.redis-client=jedis
在application.properties中支持关闭二级缓存
j2cache.l2-cache-open=false(默认开启)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。