using System; using Umbraco.Core; using Umbraco.Core.Cache; namespace Umbraco.Web.Cache { /// /// Handles Application cache invalidation/refreshing /// public sealed class ApplicationCacheRefresher : CacheRefresherBase { 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.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationsCacheKey); base.RefreshAll(); } public override void Refresh(int id) { Remove(id); base.Refresh(id); } public override void Remove(int id) { ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(CacheKeys.ApplicationsCacheKey); base.Remove(id); } } }