Commerce Caching - Timeout - Best practices?

Vote:
 

Hi everybody.

We have a commerce site with +200.000 variants and we experience that the cache is often empty when users are fetching products/variants/categories - Propably because many products/variants are not accessed very often. Our initial thoughts were to increase the different relevant timeouts in the Commerce config files, but we are unsure that the side effects might be.

Is there any reason for not increasing the timeouts to "1:0:0" (one day) instead of the default 15 minutes? The only problem I can think of is an increased memory usage.

And do anybody know the difference between the different timeouts in the ecf.catalog.config? 

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

#223023
May 16, 2020 18:47
Vote:
 

Hi, Here are three cachingTimeout which I know :)

  • schemaTimeout: Currencies and WareHouses caching
  • collectionTimeout: Catalog caching
  • entryTimeout: Catalog single entry caching
#223042
May 17, 2020 5:17
Vote:
 

Hi Peter

EntryTimeoutNodeTimeout and CollectionTimeout control the cache time-out of catalog content. So it makes sense to give them the same value.

Episerver adds dependency keys to cached objects, in order to support long-time caching, while being able to refresh as soon as something is updated. So, besides the increased memory usage (as you point out), I don't recall major issues with increasing the time-out from 15 minutes to a few hours (maybe increase it further after testing).

If the cold cache loading feels very slow, you could also check if the catalog content loading can be optimized.

#223043
May 17, 2020 6:11
Peter Wind - May 17, 2020 9:28
Do you know why a timeout of only 15 minutes have been selected as the default value? It seems very low when Episerver at the same time dependency keys to control the cache invalidation? As far as I remember, the caching of standard Episerver content is way higher (12 hours)?.
Vote:
 

Thank you for your answers Sanjay and Stefan.

Which of the cachetimeouts controls the caching of pricing? Is that included when a product/variant is cached or?

#223044
May 17, 2020 7:07
Stefan Holm Olsen - May 17, 2020 7:19
None of those controls pricing. Prices are always cached for 10 minutes.
Pricing is a separate subsystem, so they are not included with products or variants.
Vote:
 

The setting here is for catalog DTO, which is the lower layer, not the catalog content. By default catalog content is cached for 10 minutes. There is no "perfect" caching time, too short and you loose the benefit of caching, too long and you force ASP.NET to go through cache trimming which is an expensive process, especially for catalog content which is both - big size and many items (and if you don't know already, each language is cached separatedly). Why would you want to increase the caching time, is there a problem you want to solve?

#223073
May 18, 2020 6:48
Peter Wind - May 18, 2020 13:49
Hi Quan.

Am I understanding this correctly?: When i fetch a number of variants that I need to show on a product page, each of those are cached as catalog DTOs but also as content in the standard content cache mechanisms?

If that is true - Where is the standard content cache timeout set?

The reason for my question is that we have a catalog consisting of a rather low number of products (~200) but with over 200.000 variants. It seems that after a short time, the cache for a particular variant is cleared resulting in increased time spent fetching the variants on page load. If a variant has just been shown, the page load is significantly faster.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.