【问题标题】:Disabling particular cache element with EhCache使用 EhCache 禁用特定缓存元素
【发布时间】:2015-03-13 00:25:14
【问题描述】:

我正在为 ehcache 使用 xml 配置,如下所示:-

<ehcache>

<cache name="ThumbnailCache" maxElementsInMemory="100" maxElementsOnDisk="100" eternal="false" timeToIdleSeconds="100" timeToLiveSeconds="100" overflowToDisk="true" diskPersistent="false"
    memoryStoreEvictionPolicy="LFU" />

<cache name="PDFCache" maxElementsInMemory="100" maxElementsOnDisk="100" eternal="false" timeToIdleSeconds="1800" timeToLiveSeconds="1800" overflowToDisk="true" diskPersistent="false"
    memoryStoreEvictionPolicy="LFU" />

</ehcache>

现在我想禁用 PDFCache 而不是 ThumbnailCache。我如何实现这一目标? 我所看到的方式禁用了整个 ehcache,我不想禁用整个 ehcaching。

【问题讨论】:

    标签: spring-mvc ehcache


    【解决方案1】:

    您可以通过调用 net.sf.ehcache.Cache#setDisabled 来禁用缓存。 这样做的可能性由dynamicConfig 控制,并且默认启用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-22
      相关资源
      最近更新 更多