Application Data Caching
Application Data Caching
Available Caches
Core Commerce 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:
Cache Name | Objects cached | Default TTL (seconds) | Configuration location |
---|---|---|---|
catalogRuleBaseCache | Catalog promotion rules | 300 | ep-core: simple-timeout-caches.xml |
categoryLookupCache | Categories | 3600 | Settings: COMMERCE/SYSTEM/CACHING/CATEGORY |
childCategoryLookupCache | Child categories | 3600 | Settings: COMMERCE/SYSTEM/CACHING/CATEGORY |
dynamicContentDeliveryCache | Dynamic content | 60 | ep-core: simple-timeout-caches.xml |
groovyConditionCache | Groovy conditions | 3600 | ep-core: simple-timeout-caches.xml |
groovyScriptCache | Groovy scripts | 86400 | ep-core: simple-timeout-caches.xml |
productCharacteristicsCache | Product characteristics | 600 | ep-core-caching: cache-catalog.xml |
productLookupCache | Products and SKUs | 3600 | Settings: COMMERCE/SYSTEM/CACHING/PRODUCT |
ruleSessionConfigurationCache | Promotion rule sessions | 300 | ep-core: simple-timeout-caches.xml |
skuCodeToProductCache | Maps SKU codes to products | 3600 | Settings: COMMERCE/SYSTEM/CACHING/PRODUCTSKU |
skuGuidToProductCache | Maps SKU GUIDs to products | 3600 | Settings: COMMERCE/SYSTEM/CACHING/PRODUCTSKU |
skuUidToProductCache | Maps SKU UIDPKs to products | 3600 | Settings: COMMERCE/SYSTEM/CACHING/PRODUCTSKU |
storeCache | Stores | 3600 | ep-core-caching: cache-core.xml |
tagDefinitionGuidToTagDefinitionCache | Maps tag definition GUIDs to tag definitions | 600 | ep-core: service.xml |
tagDefinitionNameToTagDefinitionCache | Maps tag definition names to tag definitions | 600 | ep-core: service.xml |
taxDocumentCache | Shopping cart tax calculations | 300 | ep-core: service.xml |
threadLocalStoreCache | Stores | 30 | ep-core: simple-timeout-caches.xml |
Configuring Caches via Settings Framework
The settings framework can configure several caches. Each cache has three settings: timeToIdle, timeToLive, and maxEntriesLocalHeap.
For example, to change the timeToIdle and timeToLive values for categoryLookupCache 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.