Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Core Caching

Core Caching

Available Caches

The ep-core-caching module provides three out-of-the-box application caches to improve performance. These caches are available to both storefront and cortex. To monitor these caches, see Monitoring EhCache.

The table below lists the three caches and their default timeout values in seconds:

Cache Name Description Settings prefix timeToLive timeToIdle maxEntriesInHeap
categoryLookupCache Caches categories. COMMERCE/SYSTEM/CACHING/CATEGORY 1 1 1000
productLookupCache Caches products. COMMERCE/SYSTEM/CACHING/PRODUCT 1 1 5000
productSkuLookupCache Caches product skus. COMMERCE/SYSTEM/CACHING/PRODUCTSKU 1 1 10000

Configuring the Cache

Core caches are configured via the settings framework. There are three settings for each cache: timeToIdle, timeToLive, and maxEntriesLocalHeap.

For example, to change the timeToIdle and timeToLive values for the category cache to 5 minutes, change the values of the COMMERCE/SYSTEM/CACHING/CATEGORY/timeToLive and COMMERCE/SYSTEM/CACHING/CATEGORY/timeToIdle settings to 300. Note that the changes will not take effect until the application is restarted. For details on how to change these system settings, see Configuring System Settings.

Disabling Caching

Core caches have a corresponding "lookup" bean declaration in ep-core/src/main/resources/spring/service.xml. By overriding these beans in the following way, you can disable a core cache. For example, to disable the category cache, replace the categoryLookup bean definition:

<bean id="categoryLookup" class="com.elasticpath.commons.beanframework.SwitchableProxyFactoryBean">
	<property name="proxyInterface" value="com.elasticpath.service.catalog.CategoryLookup"/commerce-legacy/>
	<property name="proxy" ref="categoryLookupProxy"/commerce-legacy/>


<alias name="nonCachingCategoryLookup" alias="categoryLookup"/commerce-legacy/>