Pass preview to GetEntryOptions (#18470)
This commit is contained in:
@@ -126,7 +126,7 @@ internal sealed class DocumentCacheService : IDocumentCacheService
|
||||
scope.Complete();
|
||||
return contentCacheNode;
|
||||
},
|
||||
GetEntryOptions(key));
|
||||
GetEntryOptions(key, preview));
|
||||
|
||||
// We don't want to cache removed items, this may cause issues if the L2 serializer changes.
|
||||
if (contentCacheNode is null)
|
||||
@@ -209,13 +209,13 @@ internal sealed class DocumentCacheService : IDocumentCacheService
|
||||
ContentCacheNode? draftNode = await _databaseCacheRepository.GetContentSourceAsync(key, true);
|
||||
if (draftNode is not null)
|
||||
{
|
||||
await _hybridCache.SetAsync(GetCacheKey(draftNode.Key, true), draftNode, GetEntryOptions(draftNode.Key));
|
||||
await _hybridCache.SetAsync(GetCacheKey(draftNode.Key, true), draftNode, GetEntryOptions(draftNode.Key, true));
|
||||
}
|
||||
|
||||
ContentCacheNode? publishedNode = await _databaseCacheRepository.GetContentSourceAsync(key, false);
|
||||
if (publishedNode is not null && HasPublishedAncestorPath(publishedNode.Key))
|
||||
{
|
||||
await _hybridCache.SetAsync(GetCacheKey(publishedNode.Key, false), publishedNode, GetEntryOptions(publishedNode.Key));
|
||||
await _hybridCache.SetAsync(GetCacheKey(publishedNode.Key, false), publishedNode, GetEntryOptions(publishedNode.Key, false));
|
||||
}
|
||||
|
||||
scope.Complete();
|
||||
@@ -276,9 +276,9 @@ internal sealed class DocumentCacheService : IDocumentCacheService
|
||||
LocalCacheExpiration = _cacheSettings.Entry.Document.SeedCacheDuration
|
||||
};
|
||||
|
||||
private HybridCacheEntryOptions GetEntryOptions(Guid key)
|
||||
private HybridCacheEntryOptions GetEntryOptions(Guid key, bool preview)
|
||||
{
|
||||
if (SeedKeys.Contains(key))
|
||||
if (SeedKeys.Contains(key) && preview is false)
|
||||
{
|
||||
return GetSeedEntryOptions();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user