2019-01-02 15:24:05 +01:00
|
|
|
|
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)]
|
2019-01-02 15:42:57 +01:00
|
|
|
|
[RequiredByComponent(typeof(IUmbracoCoreComponent))] // runs before every other IUmbracoCoreComponent!
|
2019-01-02 15:24:05 +01:00
|
|
|
|
public class DistributedCacheBinderComponent : UmbracoComponentBase, IUmbracoCoreComponent
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void Compose(Composition composition)
|
|
|
|
|
|
{
|
2019-01-02 15:42:57 +01:00
|
|
|
|
composition.RegisterUnique<IDistributedCacheBinder, DistributedCacheBinder>();
|
2019-01-02 15:24:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Initialize(IDistributedCacheBinder distributedCacheBinder)
|
|
|
|
|
|
{
|
|
|
|
|
|
distributedCacheBinder.BindEvents();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|