Optimizing Performance
Application Data Caching
Available Caches
Elastic Path provides several out-of-the-box application caches that are used to improve performance. The table below lists all available caches and their default timeout values in seconds as well as configuration locations:
attributeValueByAttributeUidCache
8.0.1
This cache is available as of version 8.0.1.
- Objects Cached: Attribute Values
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
baseAmountCache
- Objects Cached: Base amounts
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
brandByCodeCache
8.0.1
This cache is available as of version 8.0.1.
- Objects Cached: Brands
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
bundlePriceAdjustmentCache
- Objects Cached: Bundle price adjustments
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
cachingAttributeServicefindByKeyCache
- Objects Cached: Attributes
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
cachingCategoryServiceFindDescendantCategoriesByUidCache
7.5.1
This cache is available as of version 7.5.1.
- Objects Cached: Descendant category unique identifiers
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
cachingCategoryServiceFindFeaturedProductsUidCache
7.5.1
This cache is available as of version 7.5.1.
- Objects Cached: Featured Products unique identifiers
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
catalogByCodeCache
8.0.1
This cache is available as of version 8.0.1.
- Objects Cached: Catalogs
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
catalogRuleBaseCache
- Objects Cached: Catalog promotion rules
- Default TTL (Seconds): 300
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
categoryByUidCache
Replaces categoryLookupCache
- Objects Cached: Categories
- Default TTL (Seconds): 3600
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORYsystem setting
categoryUidByCompoundGuidCache
- Objects Cached: CategoryUids
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
categoryUidByGuidCache
- Objects Cached: CategoryUids
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
changedCatalogRuleBaseCache
- Objects Cached: Caches catalog rule base
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
changedStoreRuleBaseCache
- Objects Cached: Caches store rule base
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
childCategoryLookupCache
- Objects Cached: Child categories
- Default TTL (Seconds): 3600
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORYsystem setting
dynamicContentDeliveryCache
- Objects Cached: Dynamic content
- Default TTL (Seconds): 60
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
groovyConditionCache
- Objects Cached: Groovy conditions
- Default TTL (Seconds): 3600
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
groovyEvaluationCache
- Objects Cached: Groovy evaluations
- Default TTL (Seconds): 600
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
groovyScriptCache
- Objects Cached: Groovy scripts
- Default TTL (Seconds): 86400
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
priceListAssignmentCache
- Objects Cached: Price list assignments
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
productByUidCache
Replaces productLookupCache
- Objects Cached: Products
- Default TTL (Seconds): 3600
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTsystem setting
productCharacteristicsCache
- Objects Cached: Product characteristics
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productForStoreCache
7.5.1
This cache is available as of version 7.5.1.
- Objects Cached: Store products
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productTypeByNameCache
8.0.1
This cache is available as of version 8.0.1.
- Objects Cached: Product Types
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productUidByGuidCache
- Objects Cached: ProductUids
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productUidBySkuCodeCache
- Objects Cached: Caches a product
UIDPKby a SKU code - Default TTL (Seconds): 3600
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
productUidBySkuGuidCache
- Objects Cached: Caches a product UID by a SKU GUID
- Default TTL (Seconds): 3600
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
productUidBySkuUidCache
- Objects Cached: Caches a product
UIDPKby a SKUUIDPK - Default TTL (Seconds): 3600
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
ruleBaseByScenarioCache
- Objects Cached: Caches rule base by scenario
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleCache
- Objects Cached: Promotion rules
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleCodeByRuleNameCache
- Objects Cached: Caches promotion rule codes by rule name
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleCodeByRuleUidCache
- Objects Cached: Caches a promotion rule code by a promotion rule
UIDPK - Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleCodesByRuleUidsCache
- Objects Cached: Caches a collection of rule codes by a collection of rule
UIDPKs - Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleSessionConfigurationCache
- Objects Cached: Promotion rule sessions
- Default TTL (Seconds): 300
- Configuration Location:
ep-coremodule:simple-timeout-caches.xml
skuOptionsCacheEhCache
- Objects Cached: SKU options along with their values
- Default TTL (Seconds): 86400
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
sortAttributeServiceDefaultSortAttributeForStoreCache
7.5.1
This cache is available as of version 7.5.1.
- Objects Cached: SortAttributes
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
sortAttributeServiceFindByStoreCodeAndLocaleCodeCache
7.5.1
This cache is available as of version 7.5.1.
- Objects Cached: SortValues
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
skuExistsBySkuCodeCache
- Objects Cached: Caches whether a SKU exists or not based on the SKU Code
- Default TTL (Seconds): 3600
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
storeCache
- Objects Cached: Stores
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-core.xmlfile
storeCartTypeCache
- Objects Cached: Caches names of CartTypes for a store
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-core.xmlfile
tagDefinitionCache
- Objects Cached: Caches tag definitions by GUID
- Default TTL (Seconds): 600
- Configuration Location:
ep-coremodule:service.xmlfile
tagDefinitionGuidCache
- Objects Cached: Caches tag definition GUIDs by tag definition name
- Default TTL (Seconds): 600
- Configuration Location:
ep-coremodule:service.xmlfile
taxCodeByCodeCache
8.0.1
This cache is available as of version 8.0.1.
- Objects Cached: Tax Codes
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-tax.xmlfile
taxDocumentCache
- Objects Cached: Shopping cart tax calculations
- Default TTL (Seconds): 300
- Configuration Location:
ep-coremodule:service.xmlfile
threadlocalStoreCache
- Objects Cached: Stores; Provided for backwards compatibility with storefront-enabled Self-Managed Commerce deployments
- Default TTL (Seconds): 30
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
Configuring Caches via Settings Framework
The settings framework can configure several caches. Each cache has three settings:
timeToIdle: Sets the time to idle for an element before it expires in secondstimeToLive: Sets the time to live for an element before it expires in secondsmaxEntriesLocalHeap
For example, to change the timeToIdle and timeToLive values for categoryByUidCache and childCategoryLookupCache 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.
Configuring Caches via Ehcache
All caches can be configured using Ehcache configuration files as described in Configuring Ehcache. This will override any compile-time or settings framework configuration.
OpenJPA Data Caching
OpenJPA supports caching transactional persistent entities (anything submitted or updated regularly as an online transaction such as orders, payments and customers). By default, all relatively static objects, including catalog entities, are cached unless the following annotation is specified in the source code of the persistent entity class:
@DataCache(enabled = false)
OpenJPA is configured to use Ehcache for its data and query caches, as specified by jpa-persistence.xml in ep-core.
The OpenJPA L2 cache timeout defaults to one second so that data changes are immediately visible in development, QA, and staging environments. For live environments, cache timeouts can be increased to optimize performance using an external configuration file. See Configuring Ehcache for details.
For more information on configuring OpenJPA’s properties, see the OpenJPA User’s Guide.
Override Persistence Unit Properties
Occasionally you may wish to override some of the properties defined in the core persistence unit, or add new properties. To do so, add the properties to the persistencePropertyOverrides map in the core extension’s ep-core-plugin.xml file. Do not add or change properties in any of the jpa-persistence.xml files, as the order in which these files are resolved cannot be guaranteed.