Migrate From EHCache to Caffeine

Migrate from EHCache to Caffeine in your implementation project to upgrade from Bloomreach Experience Manager 15.x to 16.y.

In Bloomreach Experience Manager 16, EHCache is refactored out in favor of the Caffeine library. This may affect implementation projects with certain customizations.

Update Custom BinariesServlet Configuration

If your implementation project contains a custom BinariesServlet cache configuration, you must migrate it from EHCache to Caffeine.

Refer to HST Binary Content Resource Serving (BinariesServlet), specifically section 3 (Cache component configuration) for details. Compare the configuration for brXM 16 with the configuration for brXM 15 and update your custom configuration accordingly.

Update CRISP Resources

If your implementation project contains any CRISP resources, you must migrate their ResourceResolver configurations from EHCache to Caffeine.

Typically in such configurations EhCacheCache is fed to SpringResourceDataCache as argument:

<bean class="org.onehippo.cms7.crisp.core.resource.SpringResourceDataCache">
  <constructor-arg>
    <bean class="org.springframework.cache.ehcache.EhCacheCache">
      <constructor-arg>
        <bean parent="abstractCrispResourceEhCache">
          <property name="cacheName" value="webdamCache" />
          <property name="maxEntriesLocalHeap" value="1000" />
          <property name="maxEntriesLocalDisk" value="0" />
          <property name="timeToLiveSeconds" value="60" />
          <property name="timeToIdleSeconds" value="60" />
        </bean>
      </constructor-arg>
    </bean>
  </constructor-arg>
</bean>

Update your configuration to instead feed CaffeineCache to SpringResourceDataCache as argument:

<bean class="org.onehippo.cms7.crisp.core.resource.SpringResourceDataCache">
  <constructor-arg>
    <bean class="org.springframework.cache.caffeine.CaffeineCache" factory-bean="caffeineCacheInstanceFactory" factory-method="createSpringCacheInstance">
      <constructor-arg value="demomarketoCache" />
      <constructor-arg value="initialCapacity=10,maximumSize=1000,expireAfterWrite=100s,expireAfterAccess=100s" />
     </bean>
   </constructor-arg>
</bean>

Refer to Configuring CRISP Addon for details.

Other Related Changes

Default JMX MBeans for Cache Instances

In brXM 14 & 15, the HST exposed MBeans for each EhCache cache instance. In brXM 16, the HST exposes MBeans for each Caffeine cache instance.

Refer to JMX Management Beans Support for details.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?