Distributed cache (IDistributedCache)
Ruvio.Extensions.Caching
Binary-safe IDistributedCache for web, worker and console apps. GetOrCreateAsync builds a missing entry once across every instance with FILLGET and FILLSET.
Use casesCache fillsSessions
dotnet add package Ruvio.Extensions.Cachingbuilder.Services.AddRuvioClient(builder.Configuration.GetSection("Ruvio"));
builder.Services.AddRuvioDistributedCache(options => options.InstanceName = "orders");
// One caller across every instance runs the factory; the others receive its result.
byte[] page = await cache.GetOrCreateAsync(
"invoice:42",
async token => await RenderAsync(token),
new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(10) });