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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user