2021-03-15 13:39:34 +11:00
|
|
|
using System;
|
2021-03-12 21:48:24 +01:00
|
|
|
using Umbraco.Cms.Core.Events;
|
2021-05-11 14:33:49 +02:00
|
|
|
using Umbraco.Cms.Core.Notifications;
|
2018-06-29 19:52:40 +02:00
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Cms.Core.Cache
|
2018-06-29 19:52:40 +02:00
|
|
|
{
|
2021-03-12 21:48:24 +01:00
|
|
|
public sealed class ApplicationCacheRefresher : CacheRefresherBase<ApplicationCacheRefresherNotification>
|
2018-06-29 19:52:40 +02:00
|
|
|
{
|
2021-03-15 13:39:34 +11:00
|
|
|
public ApplicationCacheRefresher(AppCaches appCaches, IEventAggregator eventAggregator, ICacheRefresherNotificationFactory factory)
|
|
|
|
|
: base(appCaches, eventAggregator, factory)
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-06-29 19:52:40 +02:00
|
|
|
|
|
|
|
|
#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()
|
|
|
|
|
{
|
2019-01-17 11:01:23 +01:00
|
|
|
AppCaches.RuntimeCache.Clear(CacheKeys.ApplicationsCacheKey);
|
2018-06-29 19:52:40 +02:00
|
|
|
base.RefreshAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Refresh(int id)
|
|
|
|
|
{
|
|
|
|
|
Remove(id);
|
|
|
|
|
base.Refresh(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Remove(int id)
|
|
|
|
|
{
|
2019-01-17 11:01:23 +01:00
|
|
|
AppCaches.RuntimeCache.Clear(CacheKeys.ApplicationsCacheKey);
|
2018-06-29 19:52:40 +02:00
|
|
|
base.Remove(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|