Franz.Common.Caching
1.7.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Franz.Common.Caching --version 1.7.2
NuGet\Install-Package Franz.Common.Caching -Version 1.7.2
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="Franz.Common.Caching" Version="1.7.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Caching" Version="1.7.2" />
<PackageReference Include="Franz.Common.Caching" />
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 Franz.Common.Caching --version 1.7.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Franz.Common.Caching, 1.7.2"
#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 Franz.Common.Caching@1.7.2
#: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=Franz.Common.Caching&version=1.7.2
#tool nuget:?package=Franz.Common.Caching&version=1.7.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Franz.Common.Caching
A full-featured caching module for the** Franz Framework**.
Provides pluggable cache providers(Memory, Distributed, Redis), request caching via Mediator pipelines, settings cache, and built-in observability with Serilog + OpenTelemetry.
- Current Version: 1.7.2
? Features
- ?? ** Unified abstractions**:
ICacheProvider,ICacheKeyStrategy,ISettingsCache. - ?? ** Multiple providers out of the box**:
MemoryCacheProvider(fast local)DistributedCacheProvider(SQL Server, NCache, etc.)RedisCacheProvider(scalable distributed caching).
- ?? ** Flexible key strategies**:
- Default(type + serialized payload)
- Namespaced(domain separation)
- Custom(plug in your own).
- ?? ** Mediator pipeline**:
- Automatic cache HIT/MISS detection
- Transparent response caching
- Per-request TTL + bypass
- Consistent with CQRS(cache queries, skip commands).
- ?? ** Observability out of the box**:
- Enriched Serilog logs(
FranzCorrelationId,FranzCacheKey, etc.) - OpenTelemetry** metrics**: hits, misses, lookup latency
- OpenTelemetry** trace tags**:
franz.cache.*
- Enriched Serilog logs(
- ?? ** Plug-and-play DI extensions**:
AddFranzMemoryCaching()AddFranzDistributedCaching<T>()AddFranzRedisCaching()(connection string or DI factory)AddFranzMediatorCaching().
?? Installation
dotnet add package Franz.Common.Caching
? Quickstart
// Program.cs
builder.Services.AddFranzCaching(); // defaults to in-memory
builder.Services.AddFranzMediatorCaching(opts =>
{
opts.DefaultTtl = TimeSpan.FromMinutes(10);
opts.ShouldCache = req => !req.GetType().Name.EndsWith("Command");
});
Example Mediator Query
public record GetUserByIdQuery(int Id) : IQuery<User>;
*First execution ? MISS ? fetch + cache
- Subsequent executions with same input ? HIT ? return cached response
Logs and telemetry are produced automatically.
?? Providers
In-memory
services.AddFranzMemoryCaching();
Distributed (SQL Server, NCache, etc.)
services.AddFranzDistributedCaching<SqlServerCache>();
Redis
// Simple
services.AddFranzRedisCaching("localhost:6379");
// Advanced (DI-driven)
services.AddFranzRedisCaching(sp =>
{
var cfg = sp.GetRequiredService<IConfiguration>();
return ConnectionMultiplexer.Connect(cfg.GetConnectionString("Redis"));
});
?? Observability
Serilog Logs
{
"FranzCorrelationId": "af42c6...",
"FranzPipeline": "CachingPipeline",
"FranzCacheKey": "GetUserById:{\"Id\":42}",
"FranzCacheHit": true,
"Message": "Cache HIT for GetUserByIdQuery in 0.6ms"
}
OpenTelemetry Metrics
franz_cache_hitsfranz_cache_missesfranz_cache_lookup_latency_ms
OpenTelemetry Trace Tags
franz.cache.keyfranz.cache.hitfranz.cache.ttl_seconds
?? Roadmap
- Support for hashed cache keys (short keys for Redis).
- More built-in strategies (e.g., sliding expiration).
- Deeper integration with
Franz.Common.Settings.
Franz.Common.Caching is production-ready:
? Cache providers + Mediator integration + observability, all out of the box.
Version 1.6.20
- Updated to .NET 10.0
| Product | Versions 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.
-
net10.0
- Franz.Common.Mediator (>= 1.7.2)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Caching.Memory (>= 10.0.0)
- StackExchange.Redis (>= 2.10.1)
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 |
|---|---|---|
| 2.0.2 | 59 | 3/30/2026 |
| 2.0.1 | 81 | 3/29/2026 |
| 1.7.8 | 90 | 3/2/2026 |
| 1.7.7 | 107 | 1/31/2026 |
| 1.7.6 | 97 | 1/22/2026 |
| 1.7.5 | 103 | 1/10/2026 |
| 1.7.4 | 122 | 12/27/2025 |
| 1.7.3 | 186 | 12/22/2025 |
| 1.7.2 | 186 | 12/21/2025 |
| 1.7.1 | 129 | 12/20/2025 |
| 1.7.0 | 293 | 12/16/2025 |
| 1.6.21 | 204 | 11/27/2025 |
| 1.6.19 | 168 | 10/25/2025 |
| 1.6.15 | 197 | 10/20/2025 |
| 1.6.14 | 197 | 10/15/2025 |
| 1.6.3 | 201 | 10/9/2025 |
| 1.6.2 | 203 | 10/7/2025 |
| 1.5.9 | 203 | 9/24/2025 |
| 1.5.4 | 245 | 9/23/2025 |
| 1.5.3 | 252 | 9/21/2025 |
Loading failed