Class ContentCacheRefresher
Provides cache refresh functionality for content items, ensuring that content-related caches are updated or invalidated in response to content changes.
Inheritance
Namespace: Umbraco.Cms.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public sealed class ContentCacheRefresher : PayloadCacheRefresherBase<ContentCacheRefresherNotification, ContentCacheRefresher.JsonPayload>, IPayloadCacheRefresher<ContentCacheRefresher.JsonPayload>, IJsonCacheRefresher, ICacheRefresher, IDiscoverable
Remarks
The ContentCacheRefresher coordinates cache invalidation for content, including memory caches, URL caches, navigation structures, and domain assignments. It responds to content change notifications and ensures that all relevant caches reflect the current state of published and unpublished content. This refresher is used internally to maintain cache consistency after content operations such as publish, unpublish, move, or delete.
Constructors
View SourceContentCacheRefresher(AppCaches, IJsonSerializer, IIdKeyMap, IDomainService, IEventAggregator, ICacheRefresherNotificationFactory, IDocumentUrlService, IDomainCacheService, IDocumentNavigationQueryService, IDocumentNavigationManagementService, IContentService, IPublishStatusManagementService, IDocumentCacheService, ICacheManager)
Initializes a new instance of the ContentCacheRefresher class.
Declaration
[Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 19.")]
public ContentCacheRefresher(AppCaches appCaches, IJsonSerializer serializer, IIdKeyMap idKeyMap, IDomainService domainService, IEventAggregator eventAggregator, ICacheRefresherNotificationFactory factory, IDocumentUrlService documentUrlService, IDomainCacheService domainCacheService, IDocumentNavigationQueryService documentNavigationQueryService, IDocumentNavigationManagementService documentNavigationManagementService, IContentService contentService, IPublishStatusManagementService publishStatusManagementService, IDocumentCacheService documentCacheService, ICacheManager cacheManager)
Parameters
| Type | Name | Description |
|---|---|---|
| AppCaches | appCaches | |
| IJsonSerializer | serializer | |
| IIdKeyMap | idKeyMap | |
| IDomainService | domainService | |
| IEventAggregator | eventAggregator | |
| ICacheRefresherNotificationFactory | factory | |
| IDocumentUrlService | documentUrlService | |
| IDomainCacheService | domainCacheService | |
| IDocumentNavigationQueryService | documentNavigationQueryService | |
| IDocumentNavigationManagementService | documentNavigationManagementService | |
| IContentService | contentService | |
| IPublishStatusManagementService | publishStatusManagementService | |
| IDocumentCacheService | documentCacheService | |
| ICacheManager | cacheManager |
ContentCacheRefresher(AppCaches, IJsonSerializer, IIdKeyMap, IDomainService, IEventAggregator, ICacheRefresherNotificationFactory, IDocumentUrlService, IDocumentUrlAliasService, IDomainCacheService, IDocumentNavigationQueryService, IDocumentNavigationManagementService, IContentService, IPublishStatusManagementService, IDocumentCacheService, ICacheManager)
Initializes a new instance of the ContentCacheRefresher class.
Declaration
public ContentCacheRefresher(AppCaches appCaches, IJsonSerializer serializer, IIdKeyMap idKeyMap, IDomainService domainService, IEventAggregator eventAggregator, ICacheRefresherNotificationFactory factory, IDocumentUrlService documentUrlService, IDocumentUrlAliasService documentUrlAliasService, IDomainCacheService domainCacheService, IDocumentNavigationQueryService documentNavigationQueryService, IDocumentNavigationManagementService documentNavigationManagementService, IContentService contentService, IPublishStatusManagementService publishStatusManagementService, IDocumentCacheService documentCacheService, ICacheManager cacheManager)
Parameters
| Type | Name | Description |
|---|---|---|
| AppCaches | appCaches | |
| IJsonSerializer | serializer | |
| IIdKeyMap | idKeyMap | |
| IDomainService | domainService | |
| IEventAggregator | eventAggregator | |
| ICacheRefresherNotificationFactory | factory | |
| IDocumentUrlService | documentUrlService | |
| IDocumentUrlAliasService | documentUrlAliasService | |
| IDomainCacheService | domainCacheService | |
| IDocumentNavigationQueryService | documentNavigationQueryService | |
| IDocumentNavigationManagementService | documentNavigationManagementService | |
| IContentService | contentService | |
| IPublishStatusManagementService | publishStatusManagementService | |
| IDocumentCacheService | documentCacheService | |
| ICacheManager | cacheManager |
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(ContentCacheRefresher.JsonPayload[] payloads)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonPayload[] | payloads | The payload. |
RefreshAll()
Refreshes all entities.
Declaration
public override void RefreshAll()
RefreshContentTypes(AppCaches)
Clears cached content and public access data from the provided application caches.
Declaration
public static void RefreshContentTypes(AppCaches appCaches)
Parameters
| Type | Name | Description |
|---|---|---|
| AppCaches | appCaches | The application caches instance from which to clear content and public access entries. |
RefreshInternal(JsonPayload[])
Performs internal cache refresh operations for the specified payloads.
Declaration
public override void RefreshInternal(ContentCacheRefresher.JsonPayload[] payloads)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonPayload[] | payloads | The payloads to process. |
Remove(int)
Removes an entity.
Declaration
public override void Remove(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The entity's identifier. |