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:
attributeByUidCache
- Cache Key Type: Attribute UID
- Cache Value Type: Attribute object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
attributeValueByAttributeUidCache
- Cache Key Type: Attribute UID
- Cache Value Type: List of attribute value objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
baseAmountCache
- Cache Key Type:
BaseAmountCacheKeyobject - Cache Value Type: List of base amount objects
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
brandByCodeCache
- Cache Key Type: Brand code
- Cache Value Type: Brand object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
bundlePriceAdjustmentCache
- Cache Key Type:
PriceListGuidAndBundleConstituentsKeyobject - Cache Value Type: Map of price list guid to list of product bundle objects
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
bundlePriceAdjustmentMapCache
- Cache Key Type:
ProductBundlePriceListGuidCacheKeyobject - Cache Value Type: Map of bundle constituent GUID to price adjustment object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
cachingAttributeServiceAttributesCache
- Cache Key Type: Attribute usage ID
- Cache Value Type: List of attribute objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
cachingAttributeServicefindByKeyCache
- Cache Key Type: Attribute key
- Cache Value Type: Attribute object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
cachingAttributesByProfileCache
- Cache Key Type: Customer type name
- Cache Value Type: Map of attribute key to attribute object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
cachingCategoryServiceFindCodeByUidCache
- Cache Key Type: Category code
- Cache Value Type: Category UID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
cachingSolrQueryFactorySearchableAttributeCache
- Cache Key Type: Store code
- Cache Value Type: Lucene filter query for searchable attributes
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
catalogByCodeCache
- Cache Key Type: Catalog code
- Cache Value Type: Catalog object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
categoryByUidCache
note
Formerly categoryLookupCache.
- Cache Key Type: Category UID
- Cache Value Type: Category object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORYsystem setting
categoryUidByCompoundGuidCache
- Cache Key Type: Category GUID +
|+ catalog GUID - Cache Value Type: Category UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORYsystem setting
categoryUidByGuidCache
- Cache Key Type: Category GUID
- Cache Value Type: Category UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORYsystem setting
childCategoryLookupCache
- Cache Key Type: Category UID
- Cache Value Type: List of child category UIDs
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORYsystem setting
decomposedConditionCache
- Cache Key Type: Checksum of the logical operator in Groovy syntax
- Cache Value Type: Logical operator object
- Default TTL (Seconds): Unlimited
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
defaultSortAttributeForStoreCache
- Cache Key Type: Store code
- Cache Value Type: Sort attribute object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
descendantCategoriesByUidCache
- Cache Key Type: Category UID
- Cache Value Type: List of all descendent category UIDs
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
dynamicCompleteValidatorCache
- Cache Key Type: Pair of dynamic value type definition and dynamic value options
- Cache Value Type: Validator object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
dynamicContentDeliveryCache
- Cache Key Type: Content space name
- Cache Value Type: Dynamic content delivery object
- Default TTL (Seconds): 60
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
dynamicRequiredValidatorCache
- Cache Key Type: Pair of dynamic value type definition and dynamic value options
- Cache Value Type: Validator object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
enabledStoreLocaleCache
- Cache Key Type: Store state object
- Cache Value Type: Set of supported locale objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-core.xmlfile
facetServiceFindByGuidCache
- Cache Key Type: Facet GUID
- Cache Value Type: Facet object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
facetServiceSearchableFacetsCache
- Cache Key Type: Store code
- Cache Value Type: List of facet objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
featuredProductsUidCache
- Cache Key Type: Category UID
- Cache Value Type: List of featured product UIDs
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
groovyScriptCache
- Cache Key Type: Groovy script
- Cache Value Type: Compiled Groovy as a runnable script object
- Default TTL (Seconds): 86400
- Configuration Location:
ep-coremodule:simple-timeout-caches.xmlfile
isInCategoryCache
- Cache Key Type: Pair of product UID and category GUID +
|+ catalog GUID - Cache Value Type: Boolean
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORYsystem setting
loadFilteredNavigationConfigurationCache
- Cache Key Type: Store code
- Cache Value Type: Filtered navigation configuration object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
modifiedDateByUidCache
- Cache Key Type: Rule UID
- Cache Value Type: Last modified date
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
paymentProviderConfigurationByGuidCache
- Cache Key Type: Payment provider configuration GUID
- Cache Value Type: Payment provider configuration object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-payment.xmlfile
paymentProviderConfigurationByUidCache
- Cache Key Type: Payment provider configuration UID
- Cache Value Type: Payment provider configuration object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-payment.xmlfile
priceListAssignmentCache
- Cache Key Type: Object containing catalog code, currency code, include hidden flag
- Cache Value Type: List of price list assignments
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
priceListAssignmentCacheValidity
- Cache Key Type: Object containing catalog code, currency code, include hidden flag
- Cache Value Type: Caching interval object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-pricing.xmlfile
productAssociationCriteriaCache
- Cache Key Type: Product association criteria cache key object
- Cache Value Type: List of product associations
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productAssociationCriteriaCacheValidity
- Cache Key Type: Product association criteria cache key object
- Cache Value Type: Caching interval object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productByUidCache
note
Formerly productLookupCache.
- Cache Key Type: Product UID
- Cache Value Type: Product object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTsystem setting
productCharacteristicsCache
- Cache Key Type: Product SKU code
- Cache Value Type: Product characteristics object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productForStoreCache
- Cache Key Type: Store code +
:+ product GUID - Cache Value Type: Store product object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTsystem setting
productSkuCodeBySkuGuidCache
- Cache Key Type: Product SKU GUID
- Cache Value Type: Product SKU code
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
productTypeByNameCache
- Cache Key Type: Product type name
- Cache Value Type: Product type object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
productUidByGuidCache
- Cache Key Type: Product GUID
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTsystem setting
productUidBySkuCodeCache
- Cache Key Type: Product SKU code
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
productUidBySkuGuidCache
- Cache Key Type: Product SKU GUID
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
productUidBySkuUidCache
- Cache Key Type: Product SKU UID
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
ruleByRuleGuidCache
- Cache Key Type: Rule GUID
- Cache Value Type: Rule object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleGuidByRuleNameCache
- Cache Key Type: Rule name
- Cache Value Type: Rule GUID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleGuidByRuleUidCache
- Cache Key Type: Rule UID
- Cache Value Type: Rule GUID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
ruleGuidsByRuleUidsCache
- Cache Key Type: Collection of rule UIDs
- Cache Value Type: Collection of rule GUIDs
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
sellingContextCache
- Cache Key Type: Selling context cache key object
- Cache Value Type: List of selling context rule summary objects
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
sellingContextCacheValidity
- Cache Key Type: Selling context cache key object
- Cache Value Type: Caching interval object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-cachingmodule:cache-rules.xmlfile
shippingCalculationResultCache
- Cache Key Type: Shipping calculation result cache key object
- Cache Value Type: Shipping calculation result object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/SHIPPING_RESULTsystem settings
skuExistsBySkuCodeCache
- Cache Key Type: Product SKU code
- Cache Value Type: Boolean
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKUsystem setting
skuOptionsCache
- Cache Key Type: Product type UID
- Cache Value Type: Set of sku option objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
storeAndLocaleCodesCache
- Cache Key Type: Store code + ":" + locale code
- Cache Value Type: Sort value object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-catalog.xmlfile
storeCache
- Cache Key Type: Store UID
- Cache Value Type: Store object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-core.xmlfile
storeCartTypeCache
- Cache Key Type: Store code
- Cache Value Type: Collection of cart type names
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-core.xmlfile
tagDefinitionCache
- Cache Key Type: Tag definition GUID
- Cache Value Type: Tag definition object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-coremodule:service.xmlfile
tagDefinitionGuidCache
- Cache Key Type: Tag definition name
- Cache Value Type: Tag definition GUID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-coremodule:service.xmlfile
taxCodeByCodeCache
- Cache Key Type: Tax code
- Cache Value Type: Tax code object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-tax.xmlfile
taxRegionCache
- Cache Key Type: Pair of tax category UID and tax region name
- Cache Value Type: Tax region object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-cachingmodule:cache-tax.xmlfile
threadlocalStoreCache
- Cache Key Type: Store code
- Cache Value Type: Store object
- Default TTL (Seconds): 3600
- 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 seconds.timeToLive: Sets the time to live for an element before it expires in seconds.maxEntriesLocalHeap: Sets the maximum number of objects that are allowed to exist in the cache.
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.