# Commerce Engine Connect Memory Cache settings

The Commerce Engine (CE) Connect Memory Cache stores catalog items to allow for quicker access from the storefront. The size of Commerce catalogs and the complexity of their structure can affect memory cache behavior. You can use the CE Connect Memory Cache settings to fine-tune the configuration to meet requirements of your Commerce storefront.

The CE Connect Memory Cache settings are located in the c:\inetpub\wwwroot\<site>\App_Config\Include\Y.Commerce.Engine folder, in the Sitecore.Commerce.Engine.Connect.config file.

The CE Connect Memory Cache provides the following settings (and default values):

• <cacheMemoryLimitMegabytes>500</cacheMemoryLimitMegabytes>: Establishes the limit of memory to reserve for the caching of the Catalog items (mostly SellableItems). Once the limit is reached, then the standard scavenging process starts, just like any other Sitecore cache.

• <cacheMemoryScaleFactor>3</cacheMemoryScaleFactor> : Due to the variety of the catalog structure, the raw value of the calculated cache memory size might not accurately reflect the real memory consumption. The cacheMemoryScaleFactor value is used to multiply the raw value of each cache entry. The sum of all cache entries is then compared with the value of the cacheMemoryLimitMegabytes in order to decide if the scavenging process starts. The value must be an integer.

### Note

When fine-tuning the configuration of the cache memory size, you should consider both the cacheMemoryLimitMegabytes and the cacheMemoryScaleFactor values. From the memory dump, the currentSize property value of the Sitecore.Caching.Cache object provides the calculated memory size (multiplied by the value of the scale factor). If, when compared, the calculated memory size is larger than the actual cache memory usage (as indicated by the size of the Commerce Cache in the memory dump), you can set the cacheMemoryLimitMegabytes slightly higher than the desired value to delay the scavenging process, as the actual memory consumption has been over-estimated.

• <physicalMemoryLimitPercentage>0</physicalMemoryLimitPercentage>: Sets the percentage amount of physical memory to use for caching. This parameter is for future usage and can be ignored at the moment.

• <pollingInterval>00:03:00</pollingInterval>: Sets the interval between the scavenging process for the Commerce Cache.

• <cacheExpiryInSeconds>1800</cacheExpiryInSeconds>: Sets the amount of time to retain an item in the cache. An item that has been cached for longer than the value specified in the cacheExpiryInSeconds parameter is considered staled. The scavenging process removes staled items from the cache.