ActionCache 0.1.0

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

ActionCache

NuGet Version NuGet Downloads

Namespaced response caching for ASP.NET Core โ€” Memory, Redis, SQL Server, and Azure Cosmos DB.

๐Ÿ“– Full documentation: https://jzills.github.io/action-cache/

Install

dotnet add package ActionCache                 # core + in-memory caching
dotnet add package ActionCache.Redis           # add for Redis
dotnet add package ActionCache.SqlServer       # add for SQL Server
dotnet add package ActionCache.AzureCosmos     # add for Azure Cosmos DB

Targets .NET 8 and .NET 10.

Quickstart

Register a backend:

using ActionCache.Common.Extensions;

builder.Services.AddActionCache(options =>
{
    options.UseMemoryCache(memory => memory.SizeLimit = 10_000);
});

Cache a read, evict on write:

using ActionCache.Attributes;

[HttpGet("forecasts")]
[ActionCache(Namespace = "Forecasts")]
public IActionResult Get() => Ok(_repository.All());

[HttpPost("forecasts")]
[ActionCacheEviction(Namespace = "Forecasts")]
public IActionResult Create(Forecast forecast) => Ok(_repository.Add(forecast));

Entries are grouped under a namespace, which is what makes eviction and refresh possible without tracking keys. A namespace can embed route tokens โ€” Account:{id} gives every account its own group.

What you get without asking

  • Per-user keys on authenticated endpoints, so one caller is never served another's response.
  • Stampede protection โ€” concurrent misses for one key are coalesced and the action runs once.
  • Fail-open โ€” a backend outage degrades to a cache miss and the request still succeeds.
  • Hashed keys โ€” SHA-256, so nothing readable is left in the store.

Documentation

Getting started Packages and registration
Backends Memory, Redis, SQL Server, Cosmos
Attributes Every option on the three attributes
Vary-by Who a cached response belongs to
Eviction ยท Refresh ยท Layering Operations
Resilience ยท Stampede Reliability
Observability Metrics and traces
Configuration reference Every option in one table
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 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on ActionCache:

Package Downloads
ActionCache.SqlServer

SQL Server backend for ActionCache, using the distributed cache table and sp_getapplock for distributed locking.

ActionCache.AzureCosmos

Azure Cosmos DB backend for ActionCache, with TTL-based expiry and lazy container initialization.

ActionCache.Redis

Redis backend for ActionCache, including distributed single-flight and keyspace-notification driven expiry.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 139 9/1/2026
0.0.9 242 2/14/2025
0.0.8 199 1/31/2025
0.0.7 219 12/13/2024
0.0.6 202 11/14/2024
0.0.5 195 10/27/2024
0.0.4 228 10/20/2024
0.0.3 195 10/14/2024
0.0.2 221 8/7/2024
0.0.1 208 7/14/2024