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-caching
module:cache-catalog.xml
file
attributeValueByAttributeUidCache
- Cache Key Type: Attribute UID
- Cache Value Type: List of attribute value objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
baseAmountCache
- Cache Key Type:
BaseAmountCacheKey
object - Cache Value Type: List of base amount objects
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-caching
module:cache-pricing.xml
file
brandByCodeCache
- Cache Key Type: Brand code
- Cache Value Type: Brand object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
bundlePriceAdjustmentCache
- Cache Key Type:
PriceListGuidAndBundleConstituentsKey
object - Cache Value Type: Map of price list guid to list of product bundle objects
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-caching
module:cache-pricing.xml
file
bundlePriceAdjustmentMapCache
- Cache Key Type:
ProductBundlePriceListGuidCacheKey
object - Cache Value Type: Map of bundle constituent GUID to price adjustment object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-caching
module:cache-pricing.xml
file
cachingAttributeServiceAttributesCache
- Cache Key Type: Attribute usage ID
- Cache Value Type: List of attribute objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
cachingAttributeServicefindByKeyCache
- Cache Key Type: Attribute key
- Cache Value Type: Attribute object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
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-caching
module:cache-catalog.xml
file
cachingCategoryServiceFindCodeByUidCache
- Cache Key Type: Category code
- Cache Value Type: Category UID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
cachingSolrQueryFactorySearchableAttributeCache
- Cache Key Type: Store code
- Cache Value Type: Lucene filter query for searchable attributes
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
catalogByCodeCache
- Cache Key Type: Catalog code
- Cache Value Type: Catalog object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
categoryByUidCache
note
Formerly categoryLookupCache
.
- Cache Key Type: Category UID
- Cache Value Type: Category object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORY
system setting
categoryUidByCompoundGuidCache
- Cache Key Type: Category GUID +
|
+ catalog GUID - Cache Value Type: Category UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORY
system setting
categoryUidByGuidCache
- Cache Key Type: Category GUID
- Cache Value Type: Category UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORY
system setting
childCategoryLookupCache
- Cache Key Type: Category UID
- Cache Value Type: List of child category UIDs
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORY
system 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-core
module:simple-timeout-caches.xml
file
defaultSortAttributeForStoreCache
- Cache Key Type: Store code
- Cache Value Type: Sort attribute object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
descendantCategoriesByUidCache
- Cache Key Type: Category UID
- Cache Value Type: List of all descendent category UIDs
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
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-caching
module:cache-catalog.xml
file
dynamicContentDeliveryCache
- Cache Key Type: Content space name
- Cache Value Type: Dynamic content delivery object
- Default TTL (Seconds): 60
- Configuration Location:
ep-core
module:simple-timeout-caches.xml
file
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-caching
module:cache-catalog.xml
file
enabledStoreLocaleCache
- Cache Key Type: Store state object
- Cache Value Type: Set of supported locale objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-core.xml
file
facetServiceFindByGuidCache
- Cache Key Type: Facet GUID
- Cache Value Type: Facet object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
facetServiceSearchableFacetsCache
- Cache Key Type: Store code
- Cache Value Type: List of facet objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
featuredProductsUidCache
- Cache Key Type: Category UID
- Cache Value Type: List of featured product UIDs
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
groovyScriptCache
- Cache Key Type: Groovy script
- Cache Value Type: Compiled Groovy as a runnable script object
- Default TTL (Seconds): 86400
- Configuration Location:
ep-core
module:simple-timeout-caches.xml
file
isInCategoryCache
- Cache Key Type: Pair of product UID and category GUID +
|
+ catalog GUID - Cache Value Type: Boolean
- Configuration Location:
COMMERCE/SYSTEM/CACHING/CATEGORY
system setting
loadFilteredNavigationConfigurationCache
- Cache Key Type: Store code
- Cache Value Type: Filtered navigation configuration object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
modifiedDateByUidCache
- Cache Key Type: Rule UID
- Cache Value Type: Last modified date
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-caching
module:cache-rules.xml
file
paymentProviderConfigurationByGuidCache
- Cache Key Type: Payment provider configuration GUID
- Cache Value Type: Payment provider configuration object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-payment.xml
file
paymentProviderConfigurationByUidCache
- Cache Key Type: Payment provider configuration UID
- Cache Value Type: Payment provider configuration object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-payment.xml
file
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-caching
module:cache-pricing.xml
file
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-caching
module:cache-pricing.xml
file
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-caching
module:cache-catalog.xml
file
productAssociationCriteriaCacheValidity
- Cache Key Type: Product association criteria cache key object
- Cache Value Type: Caching interval object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
productByUidCache
note
Formerly productLookupCache
.
- Cache Key Type: Product UID
- Cache Value Type: Product object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCT
system setting
productCharacteristicsCache
- Cache Key Type: Product SKU code
- Cache Value Type: Product characteristics object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
productForStoreCache
- Cache Key Type: Store code +
:
+ product GUID - Cache Value Type: Store product object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCT
system setting
productSkuCodeBySkuGuidCache
- Cache Key Type: Product SKU GUID
- Cache Value Type: Product SKU code
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKU
system setting
productTypeByNameCache
- Cache Key Type: Product type name
- Cache Value Type: Product type object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
productUidByGuidCache
- Cache Key Type: Product GUID
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCT
system setting
productUidBySkuCodeCache
- Cache Key Type: Product SKU code
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKU
system setting
productUidBySkuGuidCache
- Cache Key Type: Product SKU GUID
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKU
system setting
productUidBySkuUidCache
- Cache Key Type: Product SKU UID
- Cache Value Type: Product UID
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKU
system setting
ruleByRuleGuidCache
- Cache Key Type: Rule GUID
- Cache Value Type: Rule object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-rules.xml
file
ruleGuidByRuleNameCache
- Cache Key Type: Rule name
- Cache Value Type: Rule GUID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-rules.xml
file
ruleGuidByRuleUidCache
- Cache Key Type: Rule UID
- Cache Value Type: Rule GUID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-rules.xml
file
ruleGuidsByRuleUidsCache
- Cache Key Type: Collection of rule UIDs
- Cache Value Type: Collection of rule GUIDs
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-rules.xml
file
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-caching
module:cache-rules.xml
file
sellingContextCacheValidity
- Cache Key Type: Selling context cache key object
- Cache Value Type: Caching interval object
- Default TTL (Seconds): 600
- Configuration Location:
ep-core-caching
module:cache-rules.xml
file
shippingCalculationResultCache
- Cache Key Type: Shipping calculation result cache key object
- Cache Value Type: Shipping calculation result object
- Configuration Location:
COMMERCE/SYSTEM/CACHING/SHIPPING_RESULT
system settings
skuExistsBySkuCodeCache
- Cache Key Type: Product SKU code
- Cache Value Type: Boolean
- Configuration Location:
COMMERCE/SYSTEM/CACHING/PRODUCTSKU
system setting
skuOptionsCache
- Cache Key Type: Product type UID
- Cache Value Type: Set of sku option objects
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
storeAndLocaleCodesCache
- Cache Key Type: Store code + ":" + locale code
- Cache Value Type: Sort value object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-catalog.xml
file
storeCache
- Cache Key Type: Store UID
- Cache Value Type: Store object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-core.xml
file
storeCartTypeCache
- Cache Key Type: Store code
- Cache Value Type: Collection of cart type names
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-core.xml
file
tagDefinitionCache
- Cache Key Type: Tag definition GUID
- Cache Value Type: Tag definition object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core
module:service.xml
file
tagDefinitionGuidCache
- Cache Key Type: Tag definition name
- Cache Value Type: Tag definition GUID
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core
module:service.xml
file
taxCodeByCodeCache
- Cache Key Type: Tax code
- Cache Value Type: Tax code object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core-caching
module:cache-tax.xml
file
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-caching
module:cache-tax.xml
file
threadlocalStoreCache
- Cache Key Type: Store code
- Cache Value Type: Store object
- Default TTL (Seconds): 3600
- Configuration Location:
ep-core
module:simple-timeout-caches.xml
file
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.