1 interface inheriting from IDistributedCache
Microsoft.Extensions.Caching.Abstractions (1)
IBufferDistributedCache.cs (1)
13public interface IBufferDistributedCache : IDistributedCache
8 implementations of IDistributedCache
Microsoft.AspNetCore.Session.Tests (1)
SessionTests.cs (1)
1145private class UnreliableCache : IDistributedCache
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Storage\DiskBasedResponseCache.cs (1)
28public sealed partial class DiskBasedResponseCache : IDistributedCache
Microsoft.Extensions.AI.Tests (1)
TestInMemoryCacheStorage.cs (1)
12internal sealed class TestInMemoryCacheStorage : IDistributedCache
Microsoft.Extensions.Caching.Hybrid.Tests (3)
NullDistributedCache.cs (1)
9internal class NullDistributedCache : IDistributedCache
StampedeTests.cs (1)
32public sealed class InvalidCache : IDistributedCache, IMemoryCache
UnreliableL2Tests.cs (1)
148private sealed class UnreliableDistributedCache : IDistributedCache
Microsoft.Extensions.Caching.Memory (1)
MemoryDistributedCache.cs (1)
17public class MemoryDistributedCache : IDistributedCache
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCache.cs (1)
19public class SqlServerCache : IDistributedCache, IBufferDistributedCache
239 references to IDistributedCache
Aspire.StackExchange.Redis.DistributedCaching (2)
AspireRedisDistributedCacheExtensions.cs (2)
18/// Adds Redis distributed caching services, <see cref="IDistributedCache"/>, in the services provided by the <paramref name="builder"/>. 48/// Adds Redis distributed caching services, <see cref="IDistributedCache"/>, in the services provided by the <paramref name="builder"/>.
Aspire.StackExchange.Redis.DistributedCaching.Tests (4)
AspireRedisDistributedCacheExtensionsTests.cs (2)
22var cache = host.Services.GetRequiredService<IDistributedCache>();
DistributedCacheConformanceTests.cs (2)
62var cache = host.Services.GetRequiredService<IDistributedCache>();
Aspire.StackExchange.Redis.Tests (4)
AspireRedisExtensionsTests.cs (4)
226var distributedCache = host.Services.GetRequiredService<IDistributedCache>(); 358var distributedCache = host.Services.GetRequiredService<IDistributedCache>();
Microsoft.Analyzers.Local.Tests (1)
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (1)
92Assembly.GetAssembly(typeof(IDistributedCache))!,
Microsoft.AspNetCore.Mvc.TagHelpers (4)
Cache\DistributedCacheTagHelperStorage.cs (4)
10/// in using <see cref="IDistributedCache"/> as the store. 14private readonly IDistributedCache _distributedCache; 19/// <param name="distributedCache">The <see cref="IDistributedCache"/> to use.</param> 20public DistributedCacheTagHelperStorage(IDistributedCache distributedCache)
Microsoft.AspNetCore.Session (8)
DistributedSession.cs (4)
15/// An <see cref="ISession"/> backed by an <see cref="IDistributedCache"/>. 26private readonly IDistributedCache _cache; 43/// <param name="cache">The <see cref="IDistributedCache"/> used to store the session data.</param> 58IDistributedCache cache,
DistributedSessionStore.cs (4)
11/// An <see cref="ISessionStore"/> backed by an <see cref="IDistributedCache"/>. 15private readonly IDistributedCache _cache; 21/// <param name="cache">The <see cref="IDistributedCache"/> used to store the session data.</param> 23public DistributedSessionStore(IDistributedCache cache, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.Session.Tests (9)
SessionTests.cs (9)
664services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 713services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 762services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 810services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 862services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 925services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 991services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 1056services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions())) 1108services.AddSingleton<IDistributedCache>(new UnreliableCache(new MemoryCache(new MemoryCacheOptions()))
Microsoft.Extensions.AI (17)
ChatCompletion\DistributedCachingChatClient.cs (6)
19/// A delegating chat client that caches the results of response calls, storing them as JSON in an <see cref="IDistributedCache"/>. 23/// <see cref="IDistributedCache"/> is similarly thread-safe for concurrent use. 27/// <summary>The <see cref="IDistributedCache"/> instance that will be used as the backing store for the cache.</summary> 28private readonly IDistributedCache _storage; 35/// <param name="storage">An <see cref="IDistributedCache"/> instance that will be used as the backing store for the cache.</param> 36public DistributedCachingChatClient(IChatClient innerClient, IDistributedCache storage)
ChatCompletion\DistributedCachingChatClientBuilderExtensions.cs (3)
21/// An optional <see cref="IDistributedCache"/> instance that will be used as the backing store for the cache. If not supplied, an instance will be resolved from the service provider. 26public static ChatClientBuilder UseDistributedCache(this ChatClientBuilder builder, IDistributedCache? storage = null, Action<DistributedCachingChatClient>? configure = null) 31storage ??= services.GetRequiredService<IDistributedCache>();
Embeddings\DistributedCachingEmbeddingGenerator.cs (5)
16/// storing them as JSON in an <see cref="IDistributedCache"/>. 22/// use so long as the employed <see cref="IDistributedCache"/> is similarly thread-safe for concurrent use. 27private readonly IDistributedCache _storage; 32/// <param name="storage">A <see cref="IDistributedCache"/> instance that will be used as the backing store for the cache.</param> 34public DistributedCachingEmbeddingGenerator(IEmbeddingGenerator<TInput, TEmbedding> innerGenerator, IDistributedCache storage)
Embeddings\DistributedCachingEmbeddingGeneratorBuilderExtensions.cs (3)
24/// An optional <see cref="IDistributedCache"/> instance that will be used as the backing store for the cache. If not supplied, an instance will be resolved from the service provider. 31IDistributedCache? storage = null, 38storage ??= services.GetRequiredService<IDistributedCache>();
Microsoft.Extensions.AI.Evaluation.Reporting (12)
IResponseCacheProvider.cs (5)
11/// Provides a way to get the <see cref="IDistributedCache"/> that caches the AI responses associated with a particular 17/// responses associated with each <see cref="ScenarioRun"/> are stored in the <see cref="IDistributedCache"/> that is 26/// Returns an <see cref="IDistributedCache"/> that caches the AI responses associated with a particular 33/// An <see cref="IDistributedCache"/> that caches the AI responses associated with a particular 36ValueTask<IDistributedCache> GetCacheAsync(
ReportingConfiguration.cs (1)
182IDistributedCache cache =
ResponseCachingChatClient.cs (3)
12/// the wrapped <see cref="IChatClient"/> in the supplied <see cref="IDistributedCache"/>. 24/// <param name="cache">The <see cref="IDistributedCache"/> where the cached responses are stored.</param> 31IDistributedCache cache,
Storage\DiskBasedResponseCache.cs (1)
21/// An <see cref="IDistributedCache"/> implementation that stores cached AI responses for a particular
Storage\DiskBasedResponseCacheProvider.cs (2)
36public ValueTask<IDistributedCache> GetCacheAsync( 43return new ValueTask<IDistributedCache>(cache);
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (4)
Storage\AzureStorageResponseCache.cs (2)
29/// An <see cref="IDistributedCache"/> implementation that stores cached AI responses for a particular 50TimeSpan? timeToLiveForCacheEntries = null) : IDistributedCache
Storage\AzureStorageResponseCacheProvider.cs (2)
47public ValueTask<IDistributedCache> GetCacheAsync( 60return new ValueTask<IDistributedCache>(cache);
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (7)
ResponseCacheTester.cs (7)
42IDistributedCache cache = await provider.GetCacheAsync(nameof(AddUncachedEntry), iterationName); 63IDistributedCache cache = await provider.GetCacheAsync(nameof(RemoveCachedEntry), iterationName); 90IDistributedCache cache = await provider.GetCacheAsync(nameof(RemoveCachedEntry), iterationName); 111IDistributedCache cache = await provider.GetCacheAsync(nameof(MultipleCacheInstances), "Async"); 113IDistributedCache cache2 = await provider.GetCacheAsync(nameof(MultipleCacheInstances), "Async"); 138IDistributedCache cache = await provider.GetCacheAsync(nameof(RemoveCachedEntry), iterationName); 168IDistributedCache cache = await provider.GetCacheAsync(nameof(RemoveCachedEntry), iterationName);
Microsoft.Extensions.AI.Tests (4)
ChatCompletion\DistributedCachingChatClientTest.cs (2)
659.AddSingleton<IDistributedCache>(_storage) 799private sealed class CachingChatClientWithCustomKey(IChatClient innerClient, IDistributedCache storage)
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (2)
315.AddSingleton<IDistributedCache>(_storage) 351private sealed class CachingEmbeddingGeneratorWithCustomKey(IEmbeddingGenerator<string, Embedding<float>> innerGenerator, IDistributedCache storage)
Microsoft.Extensions.Caching.Abstractions (15)
DistributedCacheEntryOptions.cs (1)
9/// Provides the cache options for an entry in <see cref="IDistributedCache"/>.
DistributedCacheExtensions.cs (9)
12/// Extension methods for setting data in an <see cref="IDistributedCache" />. 23public static void Set(this IDistributedCache cache, string key, byte[] value) 40public static Task SetAsync(this IDistributedCache cache, string key, byte[] value, CancellationToken token = default(CancellationToken)) 55public static void SetString(this IDistributedCache cache, string key, string value) 68public static void SetString(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options) 85public static Task SetStringAsync(this IDistributedCache cache, string key, string value, CancellationToken token = default(CancellationToken)) 100public static Task SetStringAsync(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)) 114public static string? GetString(this IDistributedCache cache, string key) 131public static async Task<string?> GetStringAsync(this IDistributedCache cache, string key, CancellationToken token = default(CancellationToken))
Hybrid\HybridCache.cs (1)
15/// Provides multi-tier caching services building on <see cref="IDistributedCache"/> backends.
IBufferDistributedCache.cs (4)
21/// <remarks>This method is functionally similar to <see cref="IDistributedCache.Get(string)"/>, but avoids the array allocation.</remarks> 31/// <remarks>This method is functionally similar to <see cref="IDistributedCache.GetAsync(string, CancellationToken)"/>, but avoids the array allocation.</remarks> 40/// <remarks>This method is functionally similar to <see cref="IDistributedCache.Set(string, byte[], DistributedCacheEntryOptions)"/>, but avoids the array allocation.</remarks> 50/// <remarks>This method is functionally similar to <see cref="IDistributedCache.SetAsync(string, byte[], DistributedCacheEntryOptions, CancellationToken)"/>, but avoids the array allocation.</remarks>
Microsoft.Extensions.Caching.Hybrid (3)
Internal\DefaultHybridCache.cs (3)
33private readonly IDistributedCache? _backendCache; 77_backendCache = services.GetService<IDistributedCache>(); // note optional 126internal IDistributedCache? BackendCache => _backendCache;
Microsoft.Extensions.Caching.Hybrid.Tests (53)
BufferReleaseTests.cs (2)
120services => services.AddSingleton<IDistributedCache, TestCache>()); 185services => services.AddSingleton<IDistributedCache, TestCache>());
DistributedCacheTests.cs (6)
59var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>(); 105var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>(); 171var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>() as IBufferDistributedCache; 233var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>() as IBufferDistributedCache;
ExpirationTests.cs (1)
33services.AddSingleton<IDistributedCache>(l2);
L2Tests.cs (13)
39services.AddSingleton<IDistributedCache>(buffers ? new BufferLoggingCache(Log, localCache) : new LoggingCache(Log, localCache)); 159public BufferLoggingCache(ITestOutputHelper log, IDistributedCache tail) 207internal class LoggingCache(ITestOutputHelper log, IDistributedCache tail) : IDistributedCache 210protected IDistributedCache Tail => tail; 216byte[]? IDistributedCache.Get(string key) 223Task<byte[]?> IDistributedCache.GetAsync(string key, CancellationToken token) 230void IDistributedCache.Refresh(string key) 237Task IDistributedCache.RefreshAsync(string key, CancellationToken token) 244void IDistributedCache.Remove(string key) 251Task IDistributedCache.RemoveAsync(string key, CancellationToken token) 258void IDistributedCache.Set(string key, byte[] value, DistributedCacheEntryOptions options) 265Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token)
LocalInvalidationTests.cs (1)
54IDistributedCache? l2 = null;
NullDistributedCache.cs (8)
11byte[]? IDistributedCache.Get(string key) => null; 12Task<byte[]?> IDistributedCache.GetAsync(string key, CancellationToken token) => Task.FromResult<byte[]?>(null); 13void IDistributedCache.Refresh(string key) 18Task IDistributedCache.RefreshAsync(string key, CancellationToken token) => Task.CompletedTask; 19void IDistributedCache.Remove(string key) 24Task IDistributedCache.RemoveAsync(string key, CancellationToken token) => Task.CompletedTask; 25void IDistributedCache.Set(string key, byte[] value, DistributedCacheEntryOptions options) 30Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token) => Task.CompletedTask;
PayloadTests.cs (2)
278config.AddSingleton<IDistributedCache>(new LoggingCache(log, localCache)); 305config.AddSingleton<IDistributedCache>(new LoggingCache(log, localCache));
SampleUsage.cs (1)
91public class SomeDCService(IDistributedCache cache)
ServiceConstructionTests.cs (3)
158services.AddSingleton<IDistributedCache, MemoryDistributedCache>(); 176services.AddSingleton<IDistributedCache, CustomMemoryDistributedCache>(); 192services.AddSingleton<IDistributedCache, MemoryDistributedCache>();
SizeTests.cs (2)
156services.AddSingleton<IDistributedCache, NullDistributedCache>(); 220services.AddSingleton<IDistributedCache, NullDistributedCache>();
StampedeTests.cs (9)
18services.AddSingleton<IDistributedCache, InvalidCache>(); 41byte[]? IDistributedCache.Get(string key) => throw new NotSupportedException("Intentionally not provided"); 43Task<byte[]?> IDistributedCache.GetAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 45void IDistributedCache.Refresh(string key) => throw new NotSupportedException("Intentionally not provided"); 47Task IDistributedCache.RefreshAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 49void IDistributedCache.Remove(string key) => throw new NotSupportedException("Intentionally not provided"); 53Task IDistributedCache.RemoveAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 55void IDistributedCache.Set(string key, byte[] value, DistributedCacheEntryOptions options) => throw new NotSupportedException("Intentionally not provided"); 57Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token) => throw new NotSupportedException("Intentionally not provided");
UnreliableL2Tests.cs (5)
128var backend = services.BuildServiceProvider().GetRequiredService<IDistributedCache>(); 135services.AddSingleton<IDistributedCache>(l2); 150public UnreliableDistributedCache(IDistributedCache tail) 155public IDistributedCache Tail { get; }
Microsoft.Extensions.Caching.Memory (4)
MemoryCacheServiceCollectionExtensions.cs (3)
53/// Adds a default implementation of <see cref="IDistributedCache"/> that stores items in memory 71services.TryAdd(ServiceDescriptor.Singleton<IDistributedCache, MemoryDistributedCache>()); 77/// Adds a default implementation of <see cref="IDistributedCache"/> that stores items in memory
MemoryDistributedCache.cs (1)
15/// Implements <see cref="IDistributedCache"/> using <see cref="IMemoryCache"/>.
Microsoft.Extensions.Caching.MicroBenchmarks (2)
DistributedCacheBenchmarks.cs (2)
58sqlServer = (IBufferDistributedCache)services.BuildServiceProvider().GetRequiredService<IDistributedCache>(); 66redis = (IBufferDistributedCache)services.BuildServiceProvider().GetRequiredService<IDistributedCache>();
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCachingServicesExtensions.cs (1)
37services.Add(ServiceDescriptor.Singleton<IDistributedCache, SqlServerCache>());
Microsoft.Extensions.Caching.SqlServer.Tests (29)
SqlServerCacheServicesExtensionsTest.cs (5)
25Assert.Equal(typeof(IDistributedCache), serviceDescriptor.ServiceType); 35services.AddScoped(typeof(IDistributedCache), sp => Mock.Of<IDistributedCache>()); 48var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache)); 52Assert.IsType<SqlServerCache>(serviceProvider.GetRequiredService<IDistributedCache>());
SqlServerCacheWithDatabaseTest.cs (24)
61var cache = GetSqlServerCache(); 78var cache = GetSqlServerCache(GetCacheOptions(testClock)); 100var cache = GetSqlServerCache(GetCacheOptions(testClock)); 128var cache = GetSqlServerCache(cacheOptions); 169var cache = GetSqlServerCache(cacheOptions); 209var cache = GetSqlServerCache(GetCacheOptions(testClock)); 232var cache = GetSqlServerCache(GetCacheOptions(testClock)); 258var cache = GetSqlServerCache(GetCacheOptions(testClock)); 290var cache = GetSqlServerCache(GetCacheOptions(testClock)); 315var cache = GetSqlServerCache(GetCacheOptions(testClock)); 338var cache = GetSqlServerCache(GetCacheOptions(testClock)); 363var cache = GetSqlServerCache(GetCacheOptions(testClock)); 392var cache = GetSqlServerCache(); 419var cache = GetSqlServerCache(GetCacheOptions(testClock)); 459var cache = GetSqlServerCache(GetCacheOptions(testClock)); 488var cache = GetSqlServerCache(GetCacheOptions(testClock)); 520var cache = GetSqlServerCache(GetCacheOptions(testClock)); 576var cache = GetSqlServerCache(GetCacheOptions(testClock)); 605var cache = GetSqlServerCache(GetCacheOptions(testClock)); 633var cache = GetSqlServerCache(); 652var cache = GetSqlServerCache(); 673var cache = GetSqlServerCache(); 687private IDistributedCache GetSqlServerCache(SqlServerCacheOptions options = null) 710IDistributedCache cache,
Microsoft.Extensions.Caching.StackExchangeRedis (1)
StackExchangeRedisCacheServiceCollectionExtensions.cs (1)
32services.Add(ServiceDescriptor.Singleton<IDistributedCache, RedisCacheImpl>());
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (55)
CacheServiceExtensionsTests.cs (16)
34var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache)); 45services.AddScoped(typeof(IDistributedCache), sp => Mock.Of<IDistributedCache>()); 53var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache)); 57Assert.IsAssignableFrom<RedisCache>(serviceProvider.GetRequiredService<IDistributedCache>()); 79var distributedCache = serviceProvider.GetRequiredService<IDistributedCache>(); 96var distributedCache = serviceProvider.GetRequiredService<IDistributedCache>(); 106services.AddScoped(typeof(IDistributedCache), sp => Mock.Of<IDistributedCache>()); 124var distributedCache = services.FirstOrDefault(desc => desc.ServiceType == typeof(IDistributedCache)); 128Assert.IsAssignableFrom<RedisCache>(serviceProvider.GetRequiredService<IDistributedCache>()); 152var cache = Assert.IsAssignableFrom<RedisCache>(provider.GetRequiredService<IDistributedCache>()); 170var l2 = services.GetService<IDistributedCache>(); // note optional
Infrastructure\RedisTestConfig.cs (1)
24public static IDistributedCache CreateCacheInstance(string instanceName)
RedisCacheSetAndRemoveTests.cs (10)
22var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 32var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 45var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 62var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 79var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 95var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 105var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 119var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 136var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 159var cache = RedisTestConfig.CreateCacheInstance(GetType().Name);
TimeExpirationAsyncTests.cs (14)
40var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 58var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 79var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 92var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 108var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 124var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 144var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 157var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 170var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 186var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 204var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 217var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 242var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 272static async Task<string> GetNameAndReset(IDistributedCache cache, [CallerMemberName] string caller = "")
TimeExpirationTests.cs (14)
23var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 41var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 62var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 75var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 91var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 108var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 128var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 141var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 154var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 171var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 189var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 202var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 227var cache = RedisTestConfig.CreateCacheInstance(GetType().Name); 257static string GetNameAndReset(IDistributedCache cache, [CallerMemberName] string caller = "")