Recent Expensive Query

Hi Team,

Upon reviewing the Activity Monitor, I observed that the cmsDictionary query appears to be the most resource-intensive.! :light_bulb:

Would it be possible to cache the Dictionary for a few minutes to reduce load?

Looking forward to your thoughts :slight_smile:

Kind regards,

1 Like

Thank you, Arun, for reporting this. We’ve noticed the same issue on one of our large websites with over 20,000 pages.

Correct me if I’m wrong, but it seems like fetching dictionary values from the database every time instead of using cache could impact performance.

It would be helpful if anyone could suggest a better approach to reduce number of database queries, especially for multilingual websites with a large number of pages.

1 Like

It should be cached already, unless you are retrieving a dictionary item that doesn’t exist - in which case it can’t find it in the cache, and then tries the database.

1 Like

Interesting, this makes sense. So as developers we should ensure that the dictionary items exist, and not completely rely on the fallback nomenclature:

@Umbraco.GetDictionaryValueOrDefault("Blog: Date", "Date")

In this case if "Blog: Date" doesn’t exist, it will fire an SQL command?

1 Like

IIRC it was optimized in v13 at some point, so it would cache the missing dictionary key.

2 Likes