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.

Cortex Caching

Cortex Caching

Cortex utilizes Google's Guava caching framework to improve performance for operation results. Cortex caches by request scope, which means caches live for the duration of the request's lifecycle. Once the request processes, cache entries are evicted; thereby freeing up the allocated memory.

Caching Operation Results

Cortex caches the operation results retrieved from the database, so they can be reused throughout the request's lifecycle.

Key Operation Result Caching Classes

  • OperationResultCacheProviderImpl - Builds the Guava cache.
  • OperationResultCache - Cache for the ResourceOperation context, which has 3 ConcurrentHashMaps containing:
    • Actual operation results
    • Operation result links
    • Number of cache hits (used for informative and debugging purposes)

Operation Results Cache Optimization

By default, Guava cache is configured to evict cached entries either after 30 sec or after number of cached entries reaches 2000. Parameters are configurable via the RelOS OperationResult Cache OSGi configuration in the Felix admin console. Caches are destroyed and rebuilt when configuration values are updated through the Felix console.