SAP Commerce(Hybris) Ehcache configuration

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../config/ehcache.xsd" updateCheck="false" monitoring="autodetect"
dynamicConfig="true">
<!--
see ehcache-core-*.jar/ehcache-failsafe.xml for description of elements
-->
<diskStore path="java.io.tmpdir/yourextension_cache"/>
<cache name="productCache"
maxElementsInMemory="1000"
eternal="false"
overflowToDisk="true"
timeToLiveSeconds="60"
diskPersistent="false"
maxElementsOnDisk="2000"
memoryStoreEvictionPolicy="LRU"/></ehcache>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:utils="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

<cache:annotation-driven cache-manager="compositeYourCacheManager" key-generator="commerceCacheKeyGenerator"/>
<alias name="defaultYourCacheManagerList" alias="yourManagerList"/>
<utils:list id="defaultYourExtensionCacheManagerList">
<ref bean="defaultYourCacheManager"/>
</utils:list>
<alias name="defaultCompositeYourCacheManager" alias="compositeYourCacheManager"/>
<bean id="defaultCompositeWSCacheManager" class="org.springframework.cache.support.CompositeCacheManager">
<property name="cacheManagers">
<ref bean="yourCacheManagerList"/>
</property>
</bean>
<alias name="defaultYourCacheManager" alias="yourCacheManager"/>
<bean id="defaultYourCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="yourEhcache"/>
</bean>
<alias name="defaultYourEhcache" alias="yourEhcache"/>
<bean id="defaultYourEhcache" class="de.hybris.platform.webservicescommons.cache.TenantAwareEhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/cache/yourextension-ehcache.xml"/>
</bean></beans>
@Cacheable(value = "productCache", key = "T(de.hybris.platform.commercewebservicescommons.cache.CommerceCacheKeyGenerator).generateKey(true,true,#productCode)")public ProductWsDTO getProductByCode(@PathVariable final String productCode)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store