Merge branch 'main' into v17/dev

This commit is contained in:
Jacob Overgaard
2025-10-07 14:52:10 +02:00
87 changed files with 2898 additions and 1793 deletions

View File

@@ -17,9 +17,9 @@ internal static class HybridCacheExtensions
/// Hat-tip: https://github.com/dotnet/aspnetcore/discussions/57191
/// Will never add or alter the state of any items in the cache.
/// </remarks>
public static async Task<bool> ExistsAsync(this Microsoft.Extensions.Caching.Hybrid.HybridCache cache, string key)
public static async Task<bool> ExistsAsync<T>(this Microsoft.Extensions.Caching.Hybrid.HybridCache cache, string key)
{
(bool exists, _) = await TryGetValueAsync<object>(cache, key);
(bool exists, _) = await TryGetValueAsync<T>(cache, key);
return exists;
}

View File

@@ -205,7 +205,7 @@ internal sealed class DocumentCacheService : IDocumentCacheService
var cacheKey = GetCacheKey(key, false);
var existsInCache = await _hybridCache.ExistsAsync(cacheKey);
var existsInCache = await _hybridCache.ExistsAsync<ContentCacheNode>(cacheKey);
if (existsInCache is false)
{
uncachedKeys.Add(key);
@@ -278,7 +278,7 @@ internal sealed class DocumentCacheService : IDocumentCacheService
return false;
}
return await _hybridCache.ExistsAsync(GetCacheKey(keyAttempt.Result, preview));
return await _hybridCache.ExistsAsync<ContentCacheNode>(GetCacheKey(keyAttempt.Result, preview));
}
public async Task RefreshContentAsync(IContent content)

View File

@@ -133,7 +133,7 @@ internal sealed class MediaCacheService : IMediaCacheService
return false;
}
return await _hybridCache.ExistsAsync($"{keyAttempt.Result}");
return await _hybridCache.ExistsAsync<ContentCacheNode>($"{keyAttempt.Result}");
}
public async Task RefreshMediaAsync(IMedia media)
@@ -170,7 +170,7 @@ internal sealed class MediaCacheService : IMediaCacheService
var cacheKey = GetCacheKey(key, false);
var existsInCache = await _hybridCache.ExistsAsync(cacheKey);
var existsInCache = await _hybridCache.ExistsAsync<ContentCacheNode>(cacheKey);
if (existsInCache is false)
{
uncachedKeys.Add(key);