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
This commit is contained in:
Nikolaj Geisle
2025-09-22 16:13:00 +02:00
committed by GitHub
parent 3c592ad2cd
commit e29e612e46

View File

@@ -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;
}