Files
Umbraco-CMS/src/Umbraco.Web/Cache/ApplicationCacheRefresher.cs

46 lines
1.2 KiB
C#
Raw Normal View History

2013-04-04 21:57:41 +06:00
using System;
using Umbraco.Core;
using Umbraco.Core.Cache;
namespace Umbraco.Web.Cache
{
/// <summary>
/// Handles Application cache invalidation/refreshing
/// </summary>
public sealed class ApplicationCacheRefresher : CacheRefresherBase<ApplicationCacheRefresher>
{
protected override ApplicationCacheRefresher Instance
{
get { return this; }
}
public override Guid UniqueIdentifier
{
get { return Guid.Parse(DistributedCache.ApplicationCacheRefresherId); }
}
public override string Name
{
get { return "Applications cache refresher"; }
}
public override void RefreshAll()
{
ApplicationContext.Current.ApplicationCache.ClearCacheItem(CacheKeys.ApplicationsCacheKey);
base.RefreshAll();
2013-04-04 21:57:41 +06:00
}
public override void Refresh(int id)
{
Remove(id);
base.Refresh(id);
2013-04-04 21:57:41 +06:00
}
public override void Remove(int id)
{
ApplicationContext.Current.ApplicationCache.ClearCacheItem(CacheKeys.ApplicationsCacheKey);
base.Remove(id);
2013-04-04 21:57:41 +06:00
}
}
}