CoreEx.Caching.FusionCache 4.0.0-preview-1

This is a prerelease version of CoreEx.Caching.FusionCache.
dotnet add package CoreEx.Caching.FusionCache --version 4.0.0-preview-1
                    
NuGet\Install-Package CoreEx.Caching.FusionCache -Version 4.0.0-preview-1
                    
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="CoreEx.Caching.FusionCache" Version="4.0.0-preview-1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreEx.Caching.FusionCache" Version="4.0.0-preview-1" />
                    
Directory.Packages.props
<PackageReference Include="CoreEx.Caching.FusionCache" />
                    
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 CoreEx.Caching.FusionCache --version 4.0.0-preview-1
                    
#r "nuget: CoreEx.Caching.FusionCache, 4.0.0-preview-1"
                    
#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 CoreEx.Caching.FusionCache@4.0.0-preview-1
                    
#: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=CoreEx.Caching.FusionCache&version=4.0.0-preview-1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CoreEx.Caching.FusionCache&version=4.0.0-preview-1&prerelease
                    
Install as a Cake Tool

CoreEx.Caching.FusionCache

Provides a FusionHybridCache implementation of IHybridCache backed 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

  • 🧩 IHybridCache implementation: FusionHybridCache fulfils all IHybridCache contract methods — TryGetByKeyAsync, GetOrDefaultByKeyAsync, GetOrCreateByKeyAsync, SetByKeyAsync, RemoveByKeyAsync, and RemoveByTagAsync — against an IFusionCache instance.
  • 🔄 Options translation: FusionCacheExtensions.ToFusionCacheEntryOptions maps HybridCacheEntryOptions (LocalExpiration, DistributedExpiration, CacheStrategy, Tags) directly to a FusionCacheEntryOptions instance, including SkipDistributedCache* and SkipMemoryCache* flags derived from CacheStrategy.
  • 📦 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: RemoveByTagAsync delegates 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() registers FusionHybridCache as the scoped IHybridCache service; composing it with FusionCache's own AddFusionCache() setup is the only wiring required.
  • Entry-options escape hatch: FusionHybridCache.ConfigureEntryOptions(Action<FusionCacheEntryOptions>) accepts a fluent callback invoked on every translated FusionCacheEntryOptions before use, giving access to any FusionCache-specific setting not covered by HybridCacheEntryOptions.

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.
  • CoreEx - Defines IHybridCache, HybridCacheEntryOptions, CacheStrategy, and ICacheKeyProvider that this package implements and consumes.

Additional resources

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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