SplatDev.Cache.Hybrid
1.0.2
dotnet add package SplatDev.Cache.Hybrid --version 1.0.2
NuGet\Install-Package SplatDev.Cache.Hybrid -Version 1.0.2
<PackageReference Include="SplatDev.Cache.Hybrid" Version="1.0.2" />
<PackageVersion Include="SplatDev.Cache.Hybrid" Version="1.0.2" />
<PackageReference Include="SplatDev.Cache.Hybrid" />
paket add SplatDev.Cache.Hybrid --version 1.0.2
#r "nuget: SplatDev.Cache.Hybrid, 1.0.2"
#:package SplatDev.Cache.Hybrid@1.0.2
#addin nuget:?package=SplatDev.Cache.Hybrid&version=1.0.2
#tool nuget:?package=SplatDev.Cache.Hybrid&version=1.0.2
SplatDev.Cache.Hybrid
Microsoft.Extensions.Caching.Hybrid (HybridCache) adapter for SplatDev.Cache abstractions — L1/L2 caching with stampede protection. Requires .NET 10+.
Compatibility
| .NET | Umbraco | Package Version |
|---|---|---|
| 10.0 | 17 | 1.0.0 |
This package targets net10.0 only. For Umbraco 13 (net8.0), use
SplatDev.Cache.Redisor the built-inIMemoryCache.
Installation
dotnet add package SplatDev.Cache.Hybrid
Configuration
Basic registration
using SplatDev.Cache.Hybrid.Extensions;
builder.Services.AddHybridCacheProvider();
This registers HybridCache via AddHybridCache() (L1 = IMemoryCache, L2 = configured distributed cache) and exposes it as ICacheProvider.
Custom options
builder.Services.AddHybridCacheProvider(options =>
{
options.MaximumKeyLength = 1024;
options.DefaultEntryOptions = new HybridCacheEntryOptions
{
Expiration = TimeSpan.FromMinutes(30),
};
});
With distributed cache (L2)
If you also register a distributed cache (IDistributedCache), HybridCache automatically uses it as the L2 backend:
// L1 = MemoryCache, L2 = Redis
builder.Services.AddStackExchangeRedisCache(o => o.Configuration = "...");
builder.Services.AddHybridCacheProvider();
Usage
using SplatDev.Cache;
public class SessionService
{
private readonly ICacheProvider _cache;
public SessionService(ICacheProvider cache) => _cache = cache;
public async Task<Session?> GetSessionAsync(string sessionId)
{
return await _cache.GetOrCreateAsync(
$"session:{sessionId}",
async ct => await LoadFromDatabaseAsync(sessionId, ct),
CacheEntryOptions.WithAbsoluteExpiration(TimeSpan.FromMinutes(20)),
CancellationToken.None);
}
}
Features
- Full
ICacheProviderimplementation backed byMicrosoft.Extensions.Caching.Hybrid - Stampede protection — concurrent requests for the same key share a single factory execution
- L1 cache (
IMemoryCache) with configurable local expiration - Optional L2 distributed cache via
IDistributedCache - Thread-safe by design (HybridCache handles concurrency internally)
- Async-first with sync bridge via
GetAwaiter().GetResult()
Known limitations
- Synchronous
Get<T>throwsInvalidOperationException— useGetOrCreate<T>or async methods. - .NET 10+ only — the
Microsoft.Extensions.Caching.Hybridpackage does not support .NET 8.
Dependencies
| Package | Purpose |
|---|---|
SplatDev.Cache |
Core abstractions (ICacheProvider) |
Microsoft.Extensions.Caching.Hybrid |
HybridCache L1/L2 with stampede protection |
SplatDev.Cache.Hybrid — part of the SplatDev.Umbraco.Plugins suite. Licensed under MIT. © SplatDev Ltda.
Changelog
1.0.2 — 2026-08-24
Removes a dashboard screenshot that showed an error toast. It was captured against a site where this plugin's API was unreachable, so it advertised a broken dashboard. No screenshot is better than a misleading one; a replacement will be taken against a working install.
1.0.1 — 2026-08-24
Package metadata only: the listing now carries an icon and search tags, and the project and repository links point at the organisation that actually hosts this code. No code changes.
1.0.0 — 2026-08-24
This package now keeps a changelog. Earlier releases predate it and are not reconstructed here — consult the repository history for those. From this version on, every release records what changed for someone using it.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Caching.Hybrid (>= 9.7.0)
- SplatDev.Cache (>= 1.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 40 | 8/24/2026 |