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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SplatDev.Cache.Hybrid" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SplatDev.Cache.Hybrid" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SplatDev.Cache.Hybrid" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SplatDev.Cache.Hybrid --version 1.0.2
                    
#r "nuget: SplatDev.Cache.Hybrid, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SplatDev.Cache.Hybrid@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SplatDev.Cache.Hybrid&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SplatDev.Cache.Hybrid&version=1.0.2
                    
Install as a Cake Tool

SplatDev.Cache.Hybrid

Microsoft.Extensions.Caching.Hybrid (HybridCache) adapter for SplatDev.Cache abstractions — L1/L2 caching with stampede protection. Requires .NET 10+.

NuGet License: MIT

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.Redis or the built-in IMemoryCache.

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 ICacheProvider implementation backed by Microsoft.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> throws InvalidOperationException — use GetOrCreate<T> or async methods.
  • .NET 10+ only — the Microsoft.Extensions.Caching.Hybrid package 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 38 8/24/2026