配置ehcache.xml时注意,这个地方之前参考其他博文,有个坑。。timeToIdleSeconds、timeToLiveSeconds这两个属性要注意一下,反正我是被坑惨了,一些博文的配置为timeToIdleSeconds=5,timeToLiveSeconds=5,测试的时候每次都有缓存,结果每次都会重新查询,一直没发现问题所在,偶然之下看到这两属性才发现错误。详细情况请看https://blog.csdn.net/vtopqx/article/details/8522333这篇博文,写得比较具体。配置ehcache.xml时注意,这个地方之前参考其他博文,有个坑。。timeToIdl