From e29e612e4658ac53428cb2da132e832e548ed5dc Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Date: Mon, 22 Sep 2025 16:13:00 +0200 Subject: [PATCH] Caching: Don't remove null values from hybrid cache to avoid broken content references repeatedly requiring a database hit (closes #18892) (#20209) * Implement initial fix * Revert "Implement initial fix" This reverts commit 05e5803ebaa6330979e9a4ff6a4b343e74957ca0. * Don't remove null cache values, they can always get removed when clearing cache --- .../Services/DocumentCacheService.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs b/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs index 6457773e31..2d41bc0a12 100644 --- a/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs +++ b/src/Umbraco.PublishedCache.HybridCache/Services/DocumentCacheService.cs @@ -132,10 +132,8 @@ internal sealed class DocumentCacheService : IDocumentCacheService GetEntryOptions(key, preview), GenerateTags(key)); - // We don't want to cache removed items, this may cause issues if the L2 serializer changes. if (contentCacheNode is null) { - await _hybridCache.RemoveAsync(cacheKey); return null; }