redb.Route.Cache 4.0.1

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

redb.Route.Cache

Cache as an EIP (WSO2 Cache mediator / Camel caffeine-cache analog) over the .NET caching abstractions: IMemoryCache in-process (default, created on demand) or IDistributedCache (Redis, SQL Server, anything registered in DI).

Caching scope

.Cache("customer-${header.customerId}", TimeSpan.FromMinutes(5))
    .Enrich("http://crm/customers/${header.customerId}")
.EndCache()

On a hit the body (and, with .CacheHeaders(), the headers) comes from the cache and the inner steps are skipped; on a miss they run and the result is stored. Header cache.hit tells which. Options: .Region("customers"), .SlidingExpiration(...), .CacheHeaders(), .Distributed(), .KeyFromBody() (SHA-256 of the body instead of an explicit key).

Component

.To("cache:customers?action=get&key=${header.customerId}")
.Filter("header.cache.hit == false")
    .Enrich("http://crm/...")
    .To("cache:customers?action=put&key=${header.customerId}&ttl=5m")
.EndFilter()

cache:<region>?action=get|put|remove|clear&key=...&ttl=5m&sliding=1m&provider=memory|distributed&cacheHeaders=true. Durations: 500ms, 30s, 5m, 2h, 1d or hh:mm:ss (a bare number is refused: 5 would be five days to TimeSpan). get sets cache.hit; clear empties the region. Region and key are joined with a length-prefixed separator, so region a / key b:c and region a:b / key c are two entries.

What a hit hands back

A miss is computed once per key at a time: concurrent exchanges for the same key wait for the first one's result instead of each running the inner steps. A Stream body is buffered on the miss (the live message continues with the bytes) so a hit can replay it; a JsonNode body is copied into and out of the cache. Text and byte arrays are treated as immutable. Any other object (a POCO, a list) is shared by every hit by design: do not mutate what a cache scope handed you, or clone it first.

Setup

Nothing for the in-process cache. context.UseCache(o => o.MaxEntries = 10_000) / services.AddRedbRouteCache(o => ...) register options (and the cache: component in DI). For Distributed, register an IDistributedCache (services.AddStackExchangeRedisCache(...), AddDistributedMemoryCache(), or context.AddService(typeof(IDistributedCache), cache)). A POCO body goes through the distributed cache as JSON and comes back as the same CLR type; clear on a distributed cache removes the keys this process has written (the abstraction cannot enumerate).

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

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
4.0.1 34 9/18/2026
4.0.0 85 9/11/2026