Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Our site has a few performance issue which I've compensated for with some view/ donut caching. However I'd like to get to the root of the problem and I wondered about the dictionary. The dictionary is used extensively so that ALL ancillary text is contained in here. These items don't appear to be in the content cache so I'm curious, is the CMS making an new SQL query for each dictionary item and on every request?
To answer my own question, it does appear a new SQL query is made for each Dictionary item when it is first used and it is then cached. This is a bit shonky, but the workaround is to cache all dictionary items when the app starts and then call on my own cache - unless someone has a better way?
Why is it a bit shonky?
Why caching all items on app start is better?
I mean that the dictionary items each generate a DB query is shonky, as the overhead is much larger than a single query, rather than my workaround is shonky.
Yes, David, you are right. I think Umbraco has to improve this functionality.
I'm not sure there is even caching on first lookup. I am seeing a SQL hit every time my page is loaded for each lookup. Poking around in the DefaultCultureDictionary implementation, I don't see what caching is going on other than the Language:
Not sure if this is something that can help you but I had some issues with the Dictionary as it will sometimes always make SQL hit. For example when the key is not available anymore. I did not like it making the first request slow for the user, would rather want it to be ready on first request.
So I made a small project that fetches all keys on startup and fills cache. Then there are helpers you can use.
@Garðar Þorsteinsson Nice :-)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted