![]() |
VOOZH | about |
dotnet add package ZiggyCreatures.FusionCache --version 2.6.0
NuGet\Install-Package ZiggyCreatures.FusionCache -Version 2.6.0
<PackageReference Include="ZiggyCreatures.FusionCache" Version="2.6.0" />
<PackageVersion Include="ZiggyCreatures.FusionCache" Version="2.6.0" />Directory.Packages.props
<PackageReference Include="ZiggyCreatures.FusionCache" />Project file
paket add ZiggyCreatures.FusionCache --version 2.6.0
#r "nuget: ZiggyCreatures.FusionCache, 2.6.0"
#:package ZiggyCreatures.FusionCache@2.6.0
#addin nuget:?package=ZiggyCreatures.FusionCache&version=2.6.0Install as a Cake Addin
#tool nuget:?package=ZiggyCreatures.FusionCache&version=2.6.0Install as a Cake Tool
It was born after years of dealing with all sorts of different types of caches: memory caching, distributed caching, http caching, CDNs, browser cache, offline cache, you name it.
So I tried to put together these experiences and came up with FusionCache.
Being a hybrid cache means it can transparently work as either a normal memory cache (L1) or as a multi-level cache (L1+L2), where the distributed 2nd level (L2) can be any implementation of the standard IDistributedCache interface: this will get us better cold starts, better horizontal scalability, more resiliency and overall better performance.
FusionCache also includes an optional backplane for realtime sync between multiple nodes and advanced resiliency features like cache stampede protection, a fail-safe mechanism, soft/hard timeouts, eager refresh, full observability via logging and OpenTelemetry, tagging and much more.
It's being used in production on real-world projects with huge volumes for years, and is even used by Microsoft itself in its products like Data API Builder.
It's also compatible with the new HybridCache from Microsoft, thanks to a powerful integration.
On August 2021, FusionCache received the Google Open Source Peer Bonus Award: here is the official blogpost.
With 🦄 A Gentle Introduction you'll get yourself comfortable with the overall concepts.
Want to start using it immediately? There's a ⭐ Quick Start for you.
Curious about what you can achieve from start to finish? There's a 👩🏫 Step By Step guide.
In search of all the docs? There's a page for that, too.
If you are interested in all things caching, I published a course on Dometrain:
If you like the FusionCache docs, you may like it too.
But mind you, it's not just about FusionCache but about caching as a whole: we'll go from the very foundations to pretty advanced topics and scenarios. We'll cover performance, robustness, resiliency and we'll see different real-world problems and, most importantly, solutions for them.
I tried condensing 20+ years dealing with caching in one place, all in an approachable way.
Are you more into videos?
Along the years I've been lucky enough to be invited to some conferences, shows or podcasts both online and around the world, of course to talk about all things caching and FusionCache.
A good example is when the fine folks at On .NET invited me on the show to allow me to mumbling random caching stuff.
You can find most of them, sometimes with the related slides, in the dedicated repo here.
FusionCache has a lot of features, let's see them grouped together:
IDistributedCache can be used as an optional 2nd level, all transparentlyDuration), since they depends on the value being cached itselfILogger interfaceWe've probably all heard about the new kid on the block introduced by Microsoft with .NET 9: HybridCache.
So what does it mean for FusionCache? Does one replace the other? Or can they somehow work together?
It's pretty cool actually, so let's find out!
Just install the ZiggyCreatures.FusionCache Nuget package:
PM> Install-Package ZiggyCreatures.FusionCache
Then, let's say we have a method that loads a product from the database:
Product GetProductFromDb(int id) {
// DATABASE CALL HERE
}
(This is using the sync programming model, but it would be equally valid with the newer async one)
Then we create a FusionCache instance:
var cache = new FusionCache(new FusionCacheOptions());
or, if using :
services.AddFusionCache();
Now, to get the product from the cache and, if not there, get it from the database in an optimized way and cache it for 30 sec:
var id = 42;
cache.GetOrSet<Product>(
$"product:{id}",
_ => GetProductFromDb(id),
TimeSpan.FromSeconds(30)
);
That's it.
Distributed systems are, in general, quite complex to understand.
When using FusionCache with the distributed cache, the backplane and auto-recovery the Simulator can help us seeing the whole picture.
FusionCache targets .NET Standard 2.0 so any compatible .NET implementation is fine: this means .NET Framework (the old one), .NET Core 2+ and .NET 5/6+ (the new ones), Mono 5.4+ and more (see here for a complete rundown).
NOTE: if you are running on .NET Framework 4.6.1 and want to use .NET Standard packages Microsoft suggests to upgrade to .NET Framework 4.7.2 or higher (see the .NET Standard Documentation) to avoid some known dependency issues.
There are various alternatives out there with different features, different performance characteristics (cpu/memory) and in general a different set of pros/cons.
A feature comparison between existing .NET caching solutions may help you choose which one to use.
Yes!
FusionCache is being used in production on real world projects for years, happily handling billions of requests.
Considering that the FusionCache packages have been downloaded more than 72 million times (thanks everybody!) it may very well be used even more.
Oh, and it is being used in products by Microsoft itself, like Data API Builder!
If you find FusionCache useful please let me know, I'm interested in knowing your use case!
This is the only way for me to know how it is helping people.
Nothing to do here.
After years of using a lot of open source stuff for free, this is just me trying to give something back to the community.
Will FusionCache one day switch to a commercial model? Nope, not gonna happen.
Mind you: nothing against other projects making the switch, if done in a proper way, but no thanks not interested. And FWIW I don't even accept donations, which are btw a great thing: that should tell you how much I'm into this for the money.
Again, this is me trying to give something back to the community.
If you really want to talk about money, please consider making 🩷 a donation to a good cause of your choosing, and let me know about that.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on ZiggyCreatures.FusionCache:
| Package | Downloads |
|---|---|
|
ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson
FusionCache serializer based on Newtonsoft Json.NET |
|
|
ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis
FusionCache backplane for Redis based on the StackExchange.Redis library |
|
|
ZiggyCreatures.FusionCache.Serialization.SystemTextJson
FusionCache serializer based on System.Text.Json |
|
|
ZiggyCreatures.FusionCache.Chaos
Chaos-related utilities and implementations of various componenets (like a distributed cache or a backplane), useful for things like testing dependent components' behavior in a controlled failing environment. |
|
|
ZiggyCreatures.FusionCache.OpenTelemetry
Add native OpenTelemetry support to FusionCache. |
Showing the top 17 popular GitHub repositories that depend on ZiggyCreatures.FusionCache:
| Repository | Stars |
|---|---|
|
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
|
|
|
oqtane/oqtane.framework
Oqtane is an open-source developer productivity platform for building modern .NET applications and websites that run on Web, Desktop and Mobile.
|
|
|
Azure/data-api-builder
Data API builder provides modern REST, GraphQL endpoints and MCP tools to your Azure Databases and on-prem stores.
|
|
|
VahidN/EFCoreSecondLevelCacheInterceptor
EF Core Second Level Cache Interceptor
|
|
|
TurnerSoftware/CacheTower
An efficient multi-layered caching system for .NET
|
|
|
YSGStudyHards/DotNetExercises
⚔【DotNetGuide专栏C#/.NET/.NET Core编程技巧练习集】C#/.NET/.NET Core编程常用语法、算法、技巧、中间件、类库、工作业务实操练习集,配套详细的文章教程和代码示例,助力快速掌握C#/.NET/.NET Core中各种编程常用语法、算法、技巧、中间件、类库、工作业务实操等等。
|
|
| LANCommander/LANCommander | |
|
Corsinvest/cv4pve-admin
Web management platform for Proxmox VE clusters — like vCenter but for Proxmox
|
|
|
JasonBock/Rocks
A mocking library based on the Compiler APIs (Roslyn + Mocks)
|
|
|
dotnet/dotnet-operator-sdk
KubeOps is a Kubernetes operator sdk in dotnet. Strongly inspired by kubebuilder.
|
|
|
ikyriak/IdempotentAPI
A .NET library that handles the HTTP write operations (POST and PATCH) that can affect only once for the given request data and idempotency-key by using an ASP.NET Core attribute (filter).
|
|
|
neozhu/cleanaspire
CleanAspire is a cloud-native template built on Aspire, using .NET 10 Minimal APIs and Blazor WebAssembly to deliver lightweight, scalable PWAs with offline support.
|
|
|
DuendeSoftware/foss
Duende's Free and Open Source software.
|
|
|
DamianMorozov/OpenTgResearcher
OpenTgResearcher - tool for analyzing Telegram chats and downloading their content
|
|
|
ncosentino/DevLeader
Projects referred to by my blog, Dev Leader
|
|
|
neon-sunset/fast-cache
The fastest cache library written in C# for items with set expiration time. Easy to use, thread-safe and light on memory.
|
|
|
dr-marek-jaskula/DomainDrivenDesignUniversity
This project was made for tutorial purpose - to clearly present the domain driven design concept.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.6.0 | 1,514,589 | 3/14/2026 |
| 2.5.0 | 2,713,919 | 12/22/2025 |
| 2.4.0 | 3,836,923 | 8/17/2025 |
| 2.3.0 | 2,390,688 | 6/9/2025 |
| 2.2.0 | 1,575,453 | 4/18/2025 |
| 2.2.0-preview-1 | 11,453 | 4/6/2025 |
| 2.1.0 | 1,787,362 | 2/2/2025 |
| 2.0.2 | 769,072 | 4/18/2025 |
| 2.0.1 | 332,563 | 2/23/2025 |
| 2.0.0 | 983,583 | 1/19/2025 |
| 2.0.0-preview-4 | 5,892 | 1/1/2025 |
| 2.0.0-preview-3 | 51,527 | 12/9/2024 |
| 2.0.0-preview-2 | 3,596 | 11/14/2024 |
| 2.0.0-preview-1 | 1,947 | 11/10/2024 |
| 1.4.1 | 2,048,628 | 10/27/2024 |
| 1.4.0 | 1,688,380 | 9/15/2024 |
| 1.3.0 | 3,234,437 | 8/4/2024 |
| 1.2.0 | 831,087 | 6/2/2024 |
| 1.2.0-preview1 | 1,265 | 5/19/2024 |
| 1.1.0 | 635,360 | 4/24/2024 |
- Add: add option to configure the underlying RemoveByTag() behavior, between Remove and Expire
- Add: add MemoryLockTimeout option, just like DistributedLockTimeout option
- Add: add support for RemoveByTag("*") in the HybridCache adapter
- Add: add ReThrowDistributedLockerExceptions option
- Perf: faster GenerateOperationId()
- Fix: fixed distributed locker to work better with timeouts (in general + Eager Refresh)
- Fix: added a couple of missing ConfigureAwait(false)
- Change: in the Advisor, stop warning for a missing backplane when using L2
- Update: package dependencies