Cirreum.Cache.Hybrid 1.0.4

dotnet add package Cirreum.Cache.Hybrid --version 1.0.4
                    
NuGet\Install-Package Cirreum.Cache.Hybrid -Version 1.0.4
                    
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="Cirreum.Cache.Hybrid" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cirreum.Cache.Hybrid" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Cirreum.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 Cirreum.Cache.Hybrid --version 1.0.4
                    
#r "nuget: Cirreum.Cache.Hybrid, 1.0.4"
                    
#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 Cirreum.Cache.Hybrid@1.0.4
                    
#: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=Cirreum.Cache.Hybrid&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Cirreum.Cache.Hybrid&version=1.0.4
                    
Install as a Cake Tool

Cirreum.Cache.Hybrid

NuGet Version NuGet Downloads GitHub Release License .NET

Hybrid caching implementation for Cirreum's cache service

Supersedes the legacy Cirreum.QueryCache.Hybrid package. The lineage moved to a new package id alongside the Cirreum 1.0 foundation reset and the code-first caching model.

Overview

Cirreum.Cache.Hybrid provides a hybrid caching implementation that bridges Microsoft's HybridCache service with Cirreum's caching framework.

This library implements the ICacheService interface using Microsoft's HybridCache infrastructure, enabling automatic caching of query results with support for both local and distributed cache layers, tag-based invalidation, and failure-specific expiration policies.

Features

  • Hybrid Caching: Leverages Microsoft's HybridCache for optimal performance across local and distributed cache layers
  • Code-First Registration: The AddHybridCacheService() call is the provider choice — no CacheProvider enum or appsettings switch
  • One-Call Setup: AddHybridCacheService() auto-ensures Microsoft's AddHybridCache(), so the underlying cache is wired up out of the box
  • Tag-Based Invalidation: Cache invalidation using tags for related data
  • Failure Handling: Configurable expiration times for failed operations to prevent cache stampedes
  • Result-Aware Caching: Special handling for IResult responses with automatic failure detection

Installation

dotnet add package Cirreum.Cache.Hybrid

Usage

Basic Setup

using Cirreum.Cache.Hybrid.Extensions;

// One call: registers the Cirreum bridge AND auto-ensures Microsoft's HybridCache.
services.AddHybridCacheService();

If you need to configure HybridCache (e.g. default entry options, serializers), call Microsoft's AddHybridCache(...) yourself first — AddHybridCacheService() will detect the existing registration and leave it untouched:

services.AddHybridCache(options => { /* custom options */ });
services.AddHybridCacheService();

Query Implementation

public record GetUserQuery(int UserId) : ICacheableOperation<User>
{
    public CacheExpirationPolicy CacheExpiration => new(
        Expiration: TimeSpan.FromMinutes(15),
        LocalExpiration: TimeSpan.FromMinutes(5),
        FailureExpiration: TimeSpan.FromMinutes(1)
    );

    public string[] CacheTags => [$"user:{UserId}"];
}

The HybridCacheService automatically handles:

  • Cache-or-create patterns
  • Failure result caching with shorter expiration
  • Tag-based cache invalidation

Versioning

Cirreum.Cache.Hybrid follows Semantic Versioning:

  • Major - Breaking API changes
  • Minor - New features, backward compatible
  • Patch - Bug fixes, backward compatible

License

This project is licensed under the MIT License - see the LICENSE file for details.


Cirreum Foundation Framework Layered simplicity for modern .NET

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.4 44 7/7/2026
1.0.3 91 7/5/2026
1.0.2 91 7/4/2026
1.0.1 92 7/4/2026
1.0.0 99 7/3/2026