Fix CacheRefresher and DistributedCache

This commit is contained in:
Stephan
2019-01-02 15:24:05 +01:00
parent 5b7a205835
commit ebf15b9052
12 changed files with 253 additions and 144 deletions

View File

@@ -0,0 +1,24 @@
using Umbraco.Core;
using Umbraco.Core.Components;
using Umbraco.Core.Composing;
namespace Umbraco.Web.Cache
{
/// <summary>
/// Installs listeners on service events in order to refresh our caches.
/// </summary>
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
[RequiredComponent(typeof(IUmbracoCoreComponent))] // runs before every other IUmbracoCoreComponent!
public class DistributedCacheBinderComponent : UmbracoComponentBase, IUmbracoCoreComponent
{
public override void Compose(Composition composition)
{
composition.Container.RegisterSingleton<IDistributedCacheBinder, DistributedCacheBinder>();
}
public void Initialize(IDistributedCacheBinder distributedCacheBinder)
{
distributedCacheBinder.BindEvents();
}
}
}