Files
Umbraco-CMS/src/Umbraco.Core/Cache/ApplicationCacheRefresher.cs
Mole 2bf86acf38 V9: Place notifications in the same namespace (#10231)
* Gather all notifications in Umbraco.Cms.Core.Notifications

* Rename notifications to match convention

* Move and rename missed notifications

* Move the three remaining public notification into Umbraco.Cms.Core.Notifications
2021-05-11 14:33:49 +02:00

47 lines
1.2 KiB
C#

using System;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Notifications;
namespace Umbraco.Cms.Core.Cache
{
public sealed class ApplicationCacheRefresher : CacheRefresherBase<ApplicationCacheRefresherNotification>
{
public ApplicationCacheRefresher(AppCaches appCaches, IEventAggregator eventAggregator, ICacheRefresherNotificationFactory factory)
: base(appCaches, eventAggregator, factory)
{
}
#region Define
public static readonly Guid UniqueId = Guid.Parse("B15F34A1-BC1D-4F8B-8369-3222728AB4C8");
public override Guid RefresherUniqueId => UniqueId;
public override string Name => "Application Cache Refresher";
#endregion
#region Refresher
public override void RefreshAll()
{
AppCaches.RuntimeCache.Clear(CacheKeys.ApplicationsCacheKey);
base.RefreshAll();
}
public override void Refresh(int id)
{
Remove(id);
base.Refresh(id);
}
public override void Remove(int id)
{
AppCaches.RuntimeCache.Clear(CacheKeys.ApplicationsCacheKey);
base.Remove(id);
}
#endregion
}
}