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
This is not a question, it's info in case anyone ever has the same issue as me.
I use the dictionary to save what should be static text (e.g. 'Title', 'First name', 'Surname'), even though we only have one language. It helps bridge the gap between putting everything in the CMS, which would cause confusion, and having complaints that certain text can't be changed. When we which to use 'Last name' instead of 'Surname' it is no problem.
Unfortunately the dictionary items aren't cached. They're lazy loaded using individual database requests. This means that when your site starts up it is going to start making loads of database request. To resolve this I've create a dictionary what preloads all the dictionary items on start-up. Perhaps it will be a useful addition to someone else who uses the dictionary in the same way.
NB: This will not work as it is for multiple languages, though you'd only need to modify this to have an array of dictionaries (one per language) to do so.
Issue with that gist code. You'll end up with a new dictionary for every UmbracoHelper. This use this instead for the factory:
public class PreCachedDictionaryFactory : ICultureDictionaryFactory
private ICultureDictionary _dictionary;
public ICultureDictionary CreateDictionary()
if (_dictionary == null)
var dic = new PreCachedDictionary();
_dictionary = dic;
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted