2013-03-23 01:59:25 +06:00
|
|
|
|
using System;
|
2015-01-13 13:25:36 +11:00
|
|
|
|
using Umbraco.Core;
|
2013-03-23 01:59:25 +06:00
|
|
|
|
using Umbraco.Core.Cache;
|
2014-01-28 12:20:10 +11:00
|
|
|
|
using Umbraco.Core.Models;
|
2015-01-13 13:33:39 +11:00
|
|
|
|
|
2013-03-23 01:59:25 +06:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Cache
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// A cache refresher to ensure the dictionary cache is refreshed when dictionary change
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public sealed class DictionaryCacheRefresher : CacheRefresherBase<DictionaryCacheRefresher>
|
|
|
|
|
|
{
|
|
|
|
|
|
protected override DictionaryCacheRefresher Instance
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return this; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Guid UniqueIdentifier
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return new Guid(DistributedCache.DictionaryCacheRefresherId); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return "Dictionary cache refresher"; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Refresh(int id)
|
|
|
|
|
|
{
|
2016-01-07 19:27:59 +01:00
|
|
|
|
ClearAllIsolatedCacheByEntityType<IDictionaryItem>();
|
2013-03-23 01:59:25 +06:00
|
|
|
|
base.Refresh(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Remove(int id)
|
|
|
|
|
|
{
|
2016-01-07 19:27:59 +01:00
|
|
|
|
ClearAllIsolatedCacheByEntityType<IDictionaryItem>();
|
2013-03-23 01:59:25 +06:00
|
|
|
|
base.Remove(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|