Files
Umbraco-CMS/src/Umbraco.Core/Cache/Refreshers/ICacheRefresher.cs
Ronald Barendse c989c5e214 Support publishing multiple notifications, filter on handler type and add IDistributedCacheNotificationHandler<TNotification> (optimizes cache refreshers) (#14332)
* Clean up DistributedCache and add additional checks

* Add IEnumerable overloads to DistributedCacheExtensions

* Update handlers to use new IEnumerable overloads

* Move DistributedCacheExtensions to Core

* Restructure cache refreshers into folders

* Add IDistributedCacheNotificationHandler

* Rewrite DistributedCacheBinder into seperate IDistributedCacheNotificationHandler implementations

* Obsolete DistributedCacheBinder and use new IDistributedCacheHandler implementations

* Clean up ServerMessengerBase

* Ensure cache refreshers only process distinct values

* Add support for publishing multiple notifications and filter on handler type

* Suppress compatibility issues

* Remove DistributedCacheBinder and suppress compatibility issues

* Add ScopedNotificationPublisher<TNotificationHandler>

* Improve notification type lookup/enumeration

* Ensure INotificationAsyncHandler handles multiple notitications sequentially

* Minimize cache instruction JSON

* Chunk notifications by type to keep publish order

* Only serialize required RefreshInstruction properties
2023-06-20 11:15:47 +02:00

38 lines
932 B
C#

using Umbraco.Cms.Core.Composing;
namespace Umbraco.Cms.Core.Cache;
/// <summary>
/// The IcacheRefresher Interface is used for load balancing.
/// </summary>
public interface ICacheRefresher : IDiscoverable
{
Guid RefresherUniqueId { get; }
string Name { get; }
void RefreshAll();
void Refresh(int id);
void Remove(int id);
void Refresh(Guid id);
}
/// <summary>
/// Strongly type cache refresher that is able to refresh cache of real instances of objects as well as IDs
/// </summary>
/// <typeparam name="T"></typeparam>
/// <remarks>
/// This is much better for performance when we're not running in a load balanced environment so we can refresh the
/// cache
/// against a already resolved object instead of looking the object back up by id.
/// </remarks>
public interface ICacheRefresher<T> : ICacheRefresher
{
void Refresh(T instance);
void Remove(T instance);
}