Are Umbraco dictionary items cached?

1.3k views Asked by At

Firstly, are Umbraco dictionary Items cached? If they are, how do you change the cache settings?

Secondly, is there any way in which we can regenerate list of existing dictionary items with a new prefix?

For example, if I have dictionary items with the following names

  1. Dic_one
  2. Dic_two
  3. Dic_three
  4. Dic_four

Now I need to add a prefix, such as UK_, and I need to copy the respective Umbraco dictionary items without losing their previous values:

  1. UK_Dic_one
  2. UK_Dic_two
  3. UK_Dic_three
  4. UK_Dic_four

How could I add this prefix, while still keeping the rest of the values in the dictionary?

2

There are 2 answers

0
Astuanax On

Dictionary items by itself are not cached, though they are part of either a macro or a template which can cached (on the macro itself, or via IIS caching).

The existing dictionary items are stored in the table cmsDictionary, which you can get with the following SQL

SELECT [pk]
      ,[id]
      ,[parent]
      ,[key]
  FROM [dbo].[cmsDictionary]

From there it is just a matter of updating the existing "key" value with a prefix.

As far as the "UK" prefix goes, this is a bit strange as dictionary keys can have different languages assigned to them. Having a dictionary item UK_Dic_One with a Dutch value would be a bit confusing, that would better be solved by adding different languages and using nested dictionary items (dictionary items can be nested in version 6).

If you can add new dictionary items, I would recommend the Dictionary Dashboard that allows you to export/import and edit an XML file with dictionary items which then can be imported afterwards.

1
NinjaOnSafari On

I had the same issue. As @astuanax mentioned they are cached on template level. I was able to clear the "cache" by touching the web.config and restart the apppool.