![]() |
VOOZH | about |
dotnet add package Rig.TUnit.Caching.Hybrid --version 0.1.0-beta.2
NuGet\Install-Package Rig.TUnit.Caching.Hybrid -Version 0.1.0-beta.2
<PackageReference Include="Rig.TUnit.Caching.Hybrid" Version="0.1.0-beta.2" />
<PackageVersion Include="Rig.TUnit.Caching.Hybrid" Version="0.1.0-beta.2" />Directory.Packages.props
<PackageReference Include="Rig.TUnit.Caching.Hybrid" />Project file
paket add Rig.TUnit.Caching.Hybrid --version 0.1.0-beta.2
#r "nuget: Rig.TUnit.Caching.Hybrid, 0.1.0-beta.2"
#:package Rig.TUnit.Caching.Hybrid@0.1.0-beta.2
#addin nuget:?package=Rig.TUnit.Caching.Hybrid&version=0.1.0-beta.2&prereleaseInstall as a Cake Addin
#tool nuget:?package=Rig.TUnit.Caching.Hybrid&version=0.1.0-beta.2&prereleaseInstall as a Cake Tool
Microsoft
HybridCacheprovider — L1 in-memory with stampede coalescing and tag invalidation. No container required.
The Rig.TUnit adapter for Microsoft's
HybridCache.
HybridCacheFixture configures an HybridCache instance with sensible
test defaults (60 s default TTL, 1 MiB max payload, 1024-char max key,
local-cache TTL 30 s) and exposes the raw HybridCache plus a stampede
coalescing test surface. L2 distributed is off by default — pair with
Rig.TUnit.Caching.Redis if you want it.
GetOrCreateAsync.RemoveByTagAsync..Fusion) or plain
IMemoryCache (use .Memory).Microsoft.Extensions.Caching.Hybrid 10.x (transitive)using Rig.TUnit.Caching.Hybrid.Fixtures;
await using var fx = new HybridCacheFixture();
await fx.InitializeAsync();
var key = $"k-{Guid.NewGuid():N}";
var value = await fx.Cache.GetOrCreateAsync(key, async _ =>
{
await Task.Yield();
return "computed-value";
});
| Property | Type | Default | Description |
|---|---|---|---|
DefaultExpirationSeconds |
int |
60 |
Distributed-tier TTL |
LocalCacheExpirationSeconds |
int |
30 |
L1 (in-memory) TTL |
MaximumPayloadBytes |
int |
1_048_576 |
1 MiB guard |
MaximumKeyLength |
int |
1024 |
Key length guard |
Section name: RigTUnit:HybridCache.
Rig.TUnit.Caching.Hybrid.Fixtures.HybridCacheFixtureRig.TUnit.Caching.Hybrid.Options.HybridCacheFixtureOptionsRig.TUnit.Caching.Hybrid.Builder.HybridCacheRigBuilderPer-fixture HybridCache instance. Each test owns its own cache; no
shared state unless you explicitly wire an L2 distributed tier.
GetOrCreateAsync warm hit: ~700 ns.GetOrCreateAsync returns stale value after invalidation — check
LocalCacheExpirationSeconds > 0 combined with the L2 clear;
HybridCache does not broadcast invalidation events to the L1 unless
an L2 is wired..WithTags(["orders"]) inside GetOrCreateAsync's options.See .
HybridCache is a singleton in the DI container; pin it as
AddSingleton if you are composing your own service graph.System.Text.Json by default; register custom if your
values contain polymorphic types.See ;
baseline in benchmarks/baseline-005.json.
MIT. See .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Rig.TUnit.Caching.Hybrid:
| Package | Downloads |
|---|---|
|
Rig.TUnit.All
Meta-package containing every Rig.TUnit.* package. DISCOURAGED — prefer per-feature or per-stack meta-packages (Rig.TUnit, Rig.TUnit.Microservices). |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.2 | 64 | 4/27/2026 |
| 0.0.0-alpha.0.14 | 60 | 4/26/2026 |