ActionCache 0.1.0
dotnet add package ActionCache --version 0.1.0
NuGet\Install-Package ActionCache -Version 0.1.0
<PackageReference Include="ActionCache" Version="0.1.0" />
<PackageVersion Include="ActionCache" Version="0.1.0" />
<PackageReference Include="ActionCache" />
paket add ActionCache --version 0.1.0
#r "nuget: ActionCache, 0.1.0"
#:package ActionCache@0.1.0
#addin nuget:?package=ActionCache&version=0.1.0
#tool nuget:?package=ActionCache&version=0.1.0
ActionCache
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 | Versions 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. |
-
net10.0
- ActionCache.Abstractions (= 0.1.0)
-
net8.0
- ActionCache.Abstractions (= 0.1.0)
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.