Monday, July 31, 2017

Creating a New Custom Cache Region in Hybris


  • Create a new cahce region bean in core-cache.xml spring file. The below code is to cache only the products
   <bean name="productCacheRegion" class="de.hybris.platform.regioncache.region.impl.EHCacheRegion">
        <constructor-arg name="name" value="productCacheRegion" />
        <constructor-arg name="maxEntries" value="50000" />
        <constructor-arg name="evictionPolicy" value="LFU" />
        <property name="handledTypes">
            <array>
                <value>1</value>
            </array>
        </property>
 </bean>
    

  • Access caching by using the DefaultCacheController
Reference

No comments:

Post a Comment