加入缓存插件之后项目启动很慢,有方法解决吗?

  1. @Override
  2. public void configPlugin(Plugins me) {
  3.  
  4.     .......
  5.     
  6.     /** 缓存 */
  7.     me.add(new EhCachePlugin()); 
  8. }

微信截图_20210119174916.png

加入缓存插件之后项目启动很慢,一般在10来s,有时候差不多60s,请问怎么解决吗?

评论区

杜福忠

2021-01-19 18:41

应该是贴 ehcache.xml 配置文件的内容吧? 试试注释里面的cache再启动看看是多少,挨个cache排除看哪个配置的有问题

JFinal

2021-01-19 22:37

估计是你的缓存配置了持久化,所以重新加载的时候要重磁盘加载数据

检查 ehcache.xml 中是不是有这种配置:
diskPersistent=true

hhchor

2021-01-20 09:34

ehcache.xml文件没有做任何配置,只有这行

hhchor

2021-01-20 09:34

< diskStore path="java.io.tmpdir/shopcache" / >

SuperEric

2021-01-21 11:43

  1. <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="ehcache.xsd"
    updateCheck="false" monitoring="autodetect"
    dynamicConfig="true">


updateCheck="false"



是不是这个有问题?

热门反馈

扫码入社