Class ElementCacheRefresher
Provides cache refresh functionality for element items, ensuring that element-related caches are updated or invalidated in response to element changes.
Inheritance
Namespace: Umbraco.Cms.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public sealed class ElementCacheRefresher : PayloadCacheRefresherBase<ElementCacheRefresherNotification, ElementCacheRefresher.JsonPayload>, IPayloadCacheRefresher<ElementCacheRefresher.JsonPayload>, IJsonCacheRefresher, ICacheRefresher, IDiscoverable
Remarks
The ElementCacheRefresher coordinates cache invalidation for elements, including memory caches and isolated caches. It responds to element change notifications and ensures that all relevant caches reflect the current state of published and unpublished elements. This refresher is used internally to maintain cache consistency after element operations such as publish, unpublish, or delete.
Constructors
View SourceElementCacheRefresher(AppCaches, IJsonSerializer, IIdKeyMap, IEventAggregator, ICacheRefresherNotificationFactory, IElementCacheService, ICacheManager, IElementPublishStatusManagementService)
Initializes a new instance of the ElementCacheRefresher class.
Declaration
public ElementCacheRefresher(AppCaches appCaches, IJsonSerializer serializer, IIdKeyMap idKeyMap, IEventAggregator eventAggregator, ICacheRefresherNotificationFactory factory, IElementCacheService elementCacheService, ICacheManager cacheManager, IElementPublishStatusManagementService publishStatusManagementService)
Parameters
| Type | Name | Description |
|---|---|---|
| AppCaches | appCaches | |
| IJsonSerializer | serializer | |
| IIdKeyMap | idKeyMap | |
| IEventAggregator | eventAggregator | |
| ICacheRefresherNotificationFactory | factory | |
| IElementCacheService | elementCacheService | |
| ICacheManager | cacheManager | |
| IElementPublishStatusManagementService | publishStatusManagementService |
Fields
View SourceUniqueId
Represents a unique identifier for the cache refresher.
Declaration
public static readonly Guid UniqueId
Field Value
| Type | Description |
|---|---|
| Guid |
Properties
View SourceName
Gets the name of the refresher.
Declaration
public override string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
RefresherUniqueId
Gets the unique identifier of the refresher.
Declaration
public override Guid RefresherUniqueId { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
Methods
View SourceRefresh(Guid)
Refreshes an entity.
Declaration
public override void Refresh(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The entity's identifier. |
Refresh(int)
Refreshes an entity.
Declaration
public override void Refresh(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The entity's identifier. |
Refresh(JsonPayload[])
Refreshes as specified by a payload.
Declaration
public override void Refresh(ElementCacheRefresher.JsonPayload[] payloads)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonPayload[] | payloads | The payload. |
RefreshAll()
Refreshes all entities.
Declaration
public override void RefreshAll()
Remove(int)
Removes an entity.
Declaration
public override void Remove(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The entity's identifier. |