Sitecore词典项目 [英] Sitecore Dictionary Items
问题描述
在早期版本的Sitecore中,词典项存在问题,如果我们具有CD环境,有时Dictionary.dat文件可能无法在CD服务器上更新.
In the earlier versions of Sitecore there were an issue with dictionary items, if we have a CDs environment, sometimes the Dictionary.dat file may not get updated on CDs server.
1)Sitecore 8是否仍然存在此问题?
1) is this issue still exist with Sitecore 8 ?
2)如果可以,为我的网站实施自定义词典项目的最佳方法是什么?
2) if yes, what is the best approach to implement custom dictionary items for my website ?
推荐答案
- 我在Sitecore 8.1初始版本中有此问题.
-
要修复此问题,您需要在publish:end和publish:end:remote事件上添加新的处理程序. 这是课程:
- I have this issue on Sitecore 8.1 Initial Release.
To fix it you need to add on publish:end and publish:end:remote event a new handler. This is the class :
public class DictionaryCacheClearer
{
/// <summary>
/// Clears the whole dictionary domain cache.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
public void ClearCache(object sender, EventArgs args)
{
Translate.ResetCache();
Log.Info("Dictionary cleared", this);
}
}
在publish:end和publish:end:remote事件上,您将拥有:
On publish:end and publish:end:remote events you will have:
<event name="publish:end:remote">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site s="1">YourSite</site>
</sites>
</handler>
<handler type="YourNameSpace.DictionaryCacheClearer, YourAssembly" method="ClearCache" />
</event>
<event name="publish:end">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site s="1">YourSite</site>
</sites>
</handler>
<handler type="YourNameSpace.DictionaryCacheClearer, YourAssembly" method="ClearCache" />
</event>
您可以在此处找到其他修复程序: https://community.sitecore.net/developers/f/8/t/173
Other fix you find it here: https://community.sitecore.net/developers/f/8/t/173
这篇关于Sitecore词典项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!