World is now on Opti ID! Learn more

KhurramKhang
Feb 14, 2025
  6
(0 votes)

Comerce Connect calatog caching settings

A critical aspect of Commerce Connect is the caching mechanism for the product catalog, which enhances performance by reducing database load and improving data retrieval times. By effectively configuring and managing the catalog caching mechanisms in Optimizely Commerce Connect, applications can achieve improved performance, reduce server load, and ensure that users receive up-to-date catalog.

Catalog Caching Configurations

These settings help manage how long different types of catalog data are stored in the cache before expiration, thereby optimizing data retrieval and system performance.

Commerce Connect V13

Caching for each subsystem, including catalogs and orders, is configured within its respective configuration files. For example, caching for catalogs can be found in ecf.catalog.config located in the site's configs folder.

<Cache enabled="true" 
       collectionTimeout="0:5:0" 
       entryTimeout="0:5:0"
       nodeTimeout="0:5:0" 
       schemaTimeout="1:0:0"/>

Commerce Connect V14

 Cache settings for the Catalogs subsystem, using AppSettings.json

"EPiServer": {
       "Commerce": {
          "CatalogOptions": {
            "Cache": {
              "UseCache": true,
              "ContentVersionCacheExpiration": "00:05:00",
              "CollectionCacheExpiration": "00:05:00",
              "EntryCacheExpiration": "00:05:00",
              "NodeCacheExpiration": "00:05:00"
            }
          }
       }
    }

Cache settings for the Catalogs subsystem can be used using Startup also.

public void ConfigureServices(IServiceCollection services)
    {
        services.Configure<CatalogOptions>(o =>
        {
            o.Cache.UseCache = true;
            o.Cache.ContentVersionCacheExpiration = TimeSpan.FromMinutes(05);
            o.Cache.CollectionCacheExpiration = TimeSpan.FromMinutes(05);
            o.Cache.EntryCacheExpiration = TimeSpan.FromMinutes(05);
            o.Cache.NodeCacheExpiration = TimeSpan.FromMinutes(05);
        });
    }
  • UseCache: Enables or disables caching.
  • ContentVersionCacheExpiration: Sets the cache duration for content versions.
  • CollectionCacheExpiration: Defines the cache duration for an array of entries. The cached data primarily consists of CatalogEntryDto objects. Since the Entry object is derived from the Data Transfer Object (DTO), the DTO itself is cached. However, it is also possible to cache the Entry objects directly instead of the DTO in some cases.
  • EntryCacheExpiration: Specifies the cache duration for individual catalog entries. The cached data primarily consists of CatalogEntryDto objects.
  • NodeCacheExpiration: Determines the cache duration for catalog nodes.

Cache Invalidation

Cache invalidation ensures that outdated or modified data does not persist in the cache, maintaining data consistency. In the catalog subsystem, the cache is invalidated under the following circumstances:

Expiration: Cached data is automatically invalidated when it reaches the specified timeout duration.
Data Updates: If a catalog object is updated, the corresponding cache entries are invalidated to reflect the changes.

 

References: https://docs.developers.optimizely.com/customized-commerce/docs/caching

Feb 14, 2025

Comments

Please login to comment.
Latest blogs
Make Global Assets Site- and Language-Aware at Indexing Time

I had a support case the other day with a question around search on global assets on a multisite. This is the result of that investigation. This co...

dada | Jun 26, 2025

The remote server returned an error: (400) Bad Request – when configuring Azure Storage for an older Optimizely CMS site

How to fix a strange issue that occurred when I moved editor-uploaded files for some old Optimizely CMS 11 solutions to Azure Storage.

Tomas Hensrud Gulla | Jun 26, 2025 |

Enable Opal AI for your Optimizely products

Learn how to enable Opal AI, and meet your infinite workforce.

Tomas Hensrud Gulla | Jun 25, 2025 |

Deploying to Optimizely Frontend Hosting: A Practical Guide

Optimizely Frontend Hosting is a cloud-based solution for deploying headless frontend applications - currently supporting only Next.js projects. It...

Szymon Uryga | Jun 25, 2025

World on Opti ID

We're excited to announce that world.optimizely.com is now integrated with Opti ID! What does this mean for you? New Users:  You can now log in wit...

Patrick Lam | Jun 22, 2025

Avoid Scandinavian Letters in File Names in Optimizely CMS

Discover how Scandinavian letters in file names can break media in Optimizely CMS—and learn a simple code fix to automatically sanitize uploads for...

Henning Sjørbotten | Jun 19, 2025 |