在早期版本的Sitecore中,字典项存在问题,如果我们有CD环境,有时Dictionary.dat文件可能无法在CD服务器上更新。
1)Sitecore 8仍存在这个问题吗?
2)如果是,为我的网站实现自定义词典项目的最佳方法是什么?
答案 0 :(得分:8)
要修复它,您需要在publish:end和publish:end:remote event上添加一个新的处理程序。 这是班级:
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);
}
}
在发布时:结束并发布:结束:您将拥有的远程事件:
<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