Enable sliding cache expiration in Commerce Engine Connect
You can enable sliding cache expiration on the Commerce Engine Connect cache. The sliding cache allows frequently requested entities to be stored for longer, which means quicker access to data when responding to Storefront requests. When using the sliding cache, the cache duration increases by the specified value every time the data is requested. The more often an entity is requested, the longer it remains in the cache. Rarely requested entities do not remain in cache.
By default, the sliding expiration is disabled.
To enable sliding expiration on the Commerce Engine Connect cache:
-
Open the
\wwwroot\<Sitecore>\App_Config\Include\Y.Commerce.Engine\Sitecore.Commerce.Engine.Connect.config
file. -
In the
cacheEntry
configuration section, add theslidingExpiration
property with the required value (in milliseconds). For example:RequestResponse<cacheEntry type="Sitecore.Commerce.Engine.Connect.CacheEntrySettings, Sitecore.Commerce.Engine.Connect.Caching"> <cacheName>CommerceConnect</cacheName> <slidingExpiration>36000000<slidingExpiration> <Expiration>21600000</expiration> </cacheEntry>