Microsoft.Extensions.Caching.Hybrid
9.1.0-preview.1.25064.3
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.Extensions.Caching.Hybrid --version 9.1.0-preview.1.25064.3
NuGet\Install-Package Microsoft.Extensions.Caching.Hybrid -Version 9.1.0-preview.1.25064.3
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="9.1.0-preview.1.25064.3" />
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="9.1.0-preview.1.25064.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" />
paket add Microsoft.Extensions.Caching.Hybrid --version 9.1.0-preview.1.25064.3
#r "nuget: Microsoft.Extensions.Caching.Hybrid, 9.1.0-preview.1.25064.3"
#:package Microsoft.Extensions.Caching.Hybrid@9.1.0-preview.1.25064.3
#addin nuget:?package=Microsoft.Extensions.Caching.Hybrid&version=9.1.0-preview.1.25064.3&prerelease
#tool nuget:?package=Microsoft.Extensions.Caching.Hybrid&version=9.1.0-preview.1.25064.3&prerelease
Microsoft.Extensions.Caching.Hybrid
This package contains a concrete implementation of the HybridCache
API,
simplifying and enhancing cache usage that might previously have been built on top of IDistributedCache
.
Key features:
- built on top of
IDistributedCache
- all existing cache backends (Redis, SQL Server, CosmosDB, etc) should work immediately - simple API (all the cache, serialization, etc details from are encapsulated)
- cache-stampede protection (combining of concurrent requests for the same data)
- performance enhancements such as inbuilt support for the newer
IBufferDistributedCache
API - fully configurable serialization
Full HybridCache
documentation is here.
Full documentation
See learn.microsoft.com for full discussion of HybridCache
.
Install the package
From the command-line:
dotnet add package Microsoft.Extensions.Caching.Hybrid
Or directly in the C# project file:
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="[CURRENTVERSION]" />
</ItemGroup>
Usage example
The HybridCache
service can be registered and configured via IServiceCollection
, for example:
builder.Services.AddHybridCache(/* optional configuration /*);
Note that in many cases you may also wish to register a distributed cache backend, as discussed here; for example a Redis instance:
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = builder.Configuration.GetConnectionString("MyRedisConStr");
});
Once registered, the HybridCache
instance can be obtained via dependency-injection, allowing the
GetOrCreateAsync
API to be used to obtain data:
public class SomeService(HybridCache cache)
{
private HybridCache _cache = cache;
public async Task<SomeDataType> GetSomeInfoAsync(string name, int id, CancellationToken token = default)
{
return await _cache.GetOrCreateAsync(
$"{name}-{id}", // Unique key to the cache entry
async cancel => await GetDataFromTheSourceAsync(name, id, cancel),
cancellationToken: token
);
}
private async Task<SomeDataType> GetDataFromTheSourceAsync(string name, int id, CancellationToken token)
{
// talk to the underlying data store here - could be SQL, gRPC, HTTP, etc
}
}
Additional usage guidance - including expiration, custom serialization support, and alternate usage to reduce delegate allocation - is available on learn.microsoft.com.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.Bcl.TimeProvider (>= 9.0.1)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Caching.Memory (>= 9.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Options (>= 9.0.1)
- System.Text.Json (>= 9.0.1)
-
.NETStandard 2.0
- Microsoft.Bcl.TimeProvider (>= 9.0.1)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Caching.Memory (>= 9.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Options (>= 9.0.1)
- System.Text.Json (>= 9.0.1)
-
.NETStandard 2.1
- Microsoft.Bcl.TimeProvider (>= 9.0.1)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Caching.Memory (>= 9.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Options (>= 9.0.1)
- System.Text.Json (>= 9.0.1)
-
net8.0
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Caching.Memory (>= 9.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Options (>= 9.0.1)
-
net9.0
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Caching.Memory (>= 9.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Options (>= 9.0.1)
NuGet packages (45)
Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Caching.Hybrid:
Package | Downloads |
---|---|
Volo.Abp.Caching
Package Description |
|
Duende.AccessTokenManagement
Automatic access token management for OAuth client credential flows |
|
Duende.BFF
Backend for frontend (BFF) host for ASP.NET Core |
|
ZhileTime.Hope.Caching
Package Description |
|
Altinn.App.Api
This class library holds all the API controllers used by a standard Altinn 3 App. |
GitHub repositories (17)
Showing the top 17 popular GitHub repositories that depend on Microsoft.Extensions.Caching.Hybrid:
Repository | Stars |
---|---|
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
umbraco/Umbraco-CMS
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
|
|
ZiggyCreatures/FusionCache
FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
|
VahidN/EFCoreSecondLevelCacheInterceptor
EF Core Second Level Cache Interceptor
|
|
getcellm/cellm
Use LLMs in Excel formulas
|
|
erwinkramer/bank-api
The Bank API is a design reference project suitable to bootstrap development for a compliant and modern API.
|
|
mehmetozkaya/Design-Microservices-Architecture-with-Patterns-Principles
Design Microservices Architecture with Patterns & Principles. Design Microservices Architecture with Design Patterns, Principles and the Best Practices. How to handle millions of request with designing system for high availability, high scalability, low latency, and resilience to network failures on distributed microservices.
|
|
markjprice/cs13net9
Repository for the Packt Publishing book titled "C# 13 and .NET 9 - Modern Cross-Platform Development Fundamentals" by Mark J. Price
|
|
mehdihadeli/vertical-slice-api-template
🍰 An asp.net core template based on .Net 9, Vertical Slice Architecture, CQRS, Minimal APIs, OpenTelemetry, API Versioning and OpenAPI.
|
|
FormCms/FormCms
Open-source headless CMS built with ASP.NET Core (C#) and React, featuring REST APIs, GraphQL, and a GrapesJS page designer.
|
|
ZaqueuCavalcante/syki
Full Education Management System.
|
|
baranacikgoz/modular-monolith-ddd-vsa-webapi
A .NET 9 Webapi boilerplate with Modular Monolith approach, Domain-Driven Design and Vertical Slices architecture along with Clean Architecture principles per feature.
|
|
poorna-soysa/url-shortener-app
This repository contains a n URL Shortener sample application built with .NET 9 , NET Aspire, PostgreSQL, MediatR
|
|
ardalis/DotNetDataAccessTour
A tour of different data access approaches in .NET 8+.
|
|
marcominerva/SqlDatabaseVectorSearch
A Blazor Web App and Minimal API for performing RAG (Retrieval Augmented Generation) and vector search using the native VECTOR type in Azure SQL Database and Azure OpenAI.
|
Version | Downloads | Last Updated |
---|---|---|
9.7.0 | 14,669 | 7/8/2025 |
9.6.0 | 152,416 | 6/10/2025 |
9.5.0 | 184,538 | 5/13/2025 |
9.4.0 | 461,591 | 4/8/2025 |
9.3.0 | 288,669 | 3/11/2025 |
9.2.0-preview.1.25105.6 | 68,983 | 2/11/2025 |
9.1.0-preview.1.25064.3 | 87,900 | 1/14/2025 |
9.0.0-preview.9.24556.5 | 307,975 | 11/12/2024 |
9.0.0-preview.9.24507.7 | 51,676 | 10/8/2024 |
9.0.0-preview.7.24406.2 | 636,395 | 8/13/2024 |
9.0.0-preview.6.24328.4 | 47,787 | 7/9/2024 |
9.0.0-preview.5.24306.11 | 41,162 | 6/11/2024 |
9.0.0-preview.4.24267.6 | 14,219 | 5/21/2024 |