diff --git a/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs b/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs index d71afdeeec8e..b47e6c58c821 100644 --- a/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs +++ b/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs @@ -344,6 +344,11 @@ public void Rebuild(IReadOnlyCollection contentTypeIds) _databaseCacheRepository.Rebuild(contentTypeIds.ToList()); RebuildMemoryCacheByContentTypeAsync(contentTypeIds).GetAwaiter().GetResult(); scope.Complete(); + + // Clear the entire published content cache. + // It doesn't seem feasible to be smarter about this, as a changed content type could be used for a document, + // elements within the document, an ancestor or composition. + _publishedContentCache.Clear(); } public async Task RebuildMemoryCacheByContentTypeAsync(IEnumerable contentTypeIds) diff --git a/src/Umbraco.PublishedCache.HybridCache/Services/MediaCacheService.cs b/src/Umbraco.PublishedCache.HybridCache/Services/MediaCacheService.cs index 9fe3dc5990b2..eeeb22aac857 100644 --- a/src/Umbraco.PublishedCache.HybridCache/Services/MediaCacheService.cs +++ b/src/Umbraco.PublishedCache.HybridCache/Services/MediaCacheService.cs @@ -291,6 +291,11 @@ public void Rebuild(IReadOnlyCollection contentTypeIds) } scope.Complete(); + + // Clear the entire published content cache. + // It doesn't seem feasible to be smarter about this, as a changed content type could be used for a media item, + // elements within the media item, an ancestor, or a composition. + _publishedContentCache.Clear(); } public IEnumerable GetByContentType(IPublishedContentType contentType)