CoreEx.Caching.FusionCache
4.0.0-preview-1
dotnet add package CoreEx.Caching.FusionCache --version 4.0.0-preview-1
NuGet\Install-Package CoreEx.Caching.FusionCache -Version 4.0.0-preview-1
<PackageReference Include="CoreEx.Caching.FusionCache" Version="4.0.0-preview-1" />
<PackageVersion Include="CoreEx.Caching.FusionCache" Version="4.0.0-preview-1" />
<PackageReference Include="CoreEx.Caching.FusionCache" />
paket add CoreEx.Caching.FusionCache --version 4.0.0-preview-1
#r "nuget: CoreEx.Caching.FusionCache, 4.0.0-preview-1"
#:package CoreEx.Caching.FusionCache@4.0.0-preview-1
#addin nuget:?package=CoreEx.Caching.FusionCache&version=4.0.0-preview-1&prerelease
#tool nuget:?package=CoreEx.Caching.FusionCache&version=4.0.0-preview-1&prerelease
CoreEx.Caching.FusionCache
Provides a
FusionHybridCacheimplementation ofIHybridCachebacked by the ZiggyCreatures FusionCache library, bridging CoreEx caching contracts to FusionCache's L1/L2 hybrid and backplane capabilities.
Overview
CoreEx.Caching.FusionCache binds the IHybridCache abstraction defined in CoreEx to the open-source <a href="https://github.com/ZiggyCreatures/FusionCache">FusionCache</a> library. Application code that depends on IHybridCache requires no changes; swapping in FusionHybridCache upgrades the backing store from the built-in MemoryOnlyHybridCache to FusionCache's full feature set, including a configurable L1 in-memory cache, an optional L2 distributed cache (e.g. Redis), a memory backplane for multi-node cache coherence, and tag-based invalidation.
The package is deliberately thin: FusionHybridCache delegates every cache operation to the underlying IFusionCache instance after applying key qualification via ICacheKeyProvider and translating HybridCacheEntryOptions into FusionCacheEntryOptions via FusionCacheExtensions.ToFusionCacheEntryOptions. The CacheStrategy enum governs which tiers participate in each operation — Local disables the distributed tier, Distributed disables the in-memory tier, and Hybrid (the default) uses both.
Key capabilities
- 🧩
IHybridCacheimplementation:FusionHybridCachefulfils allIHybridCachecontract methods —TryGetByKeyAsync,GetOrDefaultByKeyAsync,GetOrCreateByKeyAsync,SetByKeyAsync,RemoveByKeyAsync, andRemoveByTagAsync— against anIFusionCacheinstance. - 🔄 Options translation:
FusionCacheExtensions.ToFusionCacheEntryOptionsmapsHybridCacheEntryOptions(LocalExpiration,DistributedExpiration,CacheStrategy,Tags) directly to aFusionCacheEntryOptionsinstance, includingSkipDistributedCache*andSkipMemoryCache*flags derived fromCacheStrategy. - 📦 L1/L2 and backplane support: relies on FusionCache's own backplane packages (
ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis,ZiggyCreatures.FusionCache.Backplane.Memory) and serializer (ZiggyCreatures.FusionCache.Serialization.SystemTextJson) that are bundled as transitive dependencies. - 🏷 Tag-based invalidation:
RemoveByTagAsyncdelegates to FusionCache's native tag-eviction API, allowing entire categories of cache entries to be invalidated by a single call. - 🔧 Single-line DI registration:
AddFusionHybridCache()registersFusionHybridCacheas the scopedIHybridCacheservice; composing it with FusionCache's ownAddFusionCache()setup is the only wiring required. - Entry-options escape hatch:
FusionHybridCache.ConfigureEntryOptions(Action<FusionCacheEntryOptions>)accepts a fluent callback invoked on every translatedFusionCacheEntryOptionsbefore use, giving access to any FusionCache-specific setting not covered byHybridCacheEntryOptions.
Key types
| Type | Description |
|---|---|
FusionHybridCache |
IHybridCache implementation backed by IFusionCache; qualifies keys via ICacheKeyProvider, translates options, and supports a per-instance ConfigureEntryOptions callback for advanced FusionCache settings. |
FusionCacheExtensions |
Static extension class; ToFusionCacheEntryOptions(HybridCacheEntryOptions?) performs the CacheStrategy-aware options translation. |
Related namespaces
CoreEx- DefinesIHybridCache,HybridCacheEntryOptions,CacheStrategy, andICacheKeyProviderthat this package implements and consumes.
Additional resources
- ZiggyCreatures FusionCache — the underlying caching library.
- FusionCache backplane documentation — configuring Redis or memory backplanes for multi-node coherence.
AI Usage Guide
An AGENTS.md file is included with this package. AI coding assistants (GitHub Copilot, Claude, Cursor, etc.) that support workspace-injected package documentation will automatically surface concise usage guidance, code examples, and Do Not rules for this package without requiring a local CoreEx checkout.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- CoreEx (>= 4.0.0-preview-1)
- ZiggyCreatures.FusionCache.Backplane.Memory (>= 2.5.0)
- ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis (>= 2.5.0)
- ZiggyCreatures.FusionCache.Serialization.SystemTextJson (>= 2.5.0)
-
net8.0
- CoreEx (>= 4.0.0-preview-1)
- ZiggyCreatures.FusionCache.Backplane.Memory (>= 2.5.0)
- ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis (>= 2.5.0)
- ZiggyCreatures.FusionCache.Serialization.SystemTextJson (>= 2.5.0)
-
net9.0
- CoreEx (>= 4.0.0-preview-1)
- ZiggyCreatures.FusionCache.Backplane.Memory (>= 2.5.0)
- ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis (>= 2.5.0)
- ZiggyCreatures.FusionCache.Serialization.SystemTextJson (>= 2.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CoreEx.Caching.FusionCache:
| Package | Downloads |
|---|---|
|
CoreEx.UnitTesting
Core .NET extensions and abstractions for the testing of backend services. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0-preview-1 | 45 | 6/20/2026 |