spring boot中使用ehcache将缓存保存到硬盘中注意的问题

1.ehcache.xml配置文件中需要设置如图所示,红标为重点

2.缓存需要调用flush()方法

3. 在项目运行之前设置属性或者在命令行设置属性:net.sf.ehcache.enableShutdownHook=true,

我则是启动类中设置属性

猜你喜欢

转载自blog.csdn.net/steven_sisi/article/details/82682640