VapeCache.Features.Invalidation
1.2.22
dotnet add package VapeCache.Features.Invalidation --version 1.2.22
NuGet\Install-Package VapeCache.Features.Invalidation -Version 1.2.22
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="VapeCache.Features.Invalidation" Version="1.2.22" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VapeCache.Features.Invalidation" Version="1.2.22" />
<PackageReference Include="VapeCache.Features.Invalidation" />
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 VapeCache.Features.Invalidation --version 1.2.22
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VapeCache.Features.Invalidation, 1.2.22"
#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 VapeCache.Features.Invalidation@1.2.22
#: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=VapeCache.Features.Invalidation&version=1.2.22
#tool nuget:?package=VapeCache.Features.Invalidation&version=1.2.22
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
VapeCache.Features.Invalidation
Optional policy-driven invalidation package for VapeCache.
What it adds
CacheInvalidationPlanandCacheInvalidationPlanBuilderICacheInvalidationPolicy<TEvent>with built-in policy implementationsICacheInvalidationExecutorto apply plans toIVapeCacheICacheInvalidationDispatcherto run all registered policies for an event- Runtime configuration via
IOptionsMonitor<CacheInvalidationOptions> - Strategic runtime profiles for common deployment shapes
Runtime Profiles
Set VapeCache:Invalidation:Profile to one of:
SmallWebsite: best-effort and low overheadHighTrafficSite: strict and concurrent executionDesktopApp: conservative best-effort behavior
You can override profile defaults with:
ThrowOnFailureExecuteTargetsInParallelEvaluatePoliciesInParallelMaxConcurrency
Install
dotnet add package VapeCache.Features.Invalidation
Example
services.AddVapeCacheInvalidation(options =>
{
options.Enabled = true;
options.EnableTagInvalidation = true;
options.Profile = CacheInvalidationProfile.SmallWebsite;
});
services.AddCacheInvalidationPolicy<OrderPlacedEvent, OrderInvalidationPolicy>();
public sealed class OrderInvalidationPolicy : ICacheInvalidationPolicy<OrderPlacedEvent>
{
public ValueTask<CacheInvalidationPlan> BuildPlanAsync(OrderPlacedEvent eventData, CancellationToken ct = default)
=> ValueTask.FromResult(new CacheInvalidationPlan(
tags: [$"order:{eventData.OrderId}", $"customer:{eventData.CustomerId}"],
zones: ["orders"]));
}
await dispatcher.DispatchAsync(new OrderPlacedEvent(orderId, customerId), ct);
Out-of-box policies
TagInvalidationPolicy<TEvent>ZoneInvalidationPolicy<TEvent>KeyInvalidationPolicy<TEvent>EntityInvalidationPolicy<TEvent>DelegateInvalidationPolicy<TEvent>StaticInvalidationPolicy<TEvent>CompositeInvalidationPolicy<TEvent>
One-line policy registration helpers
services.AddTagInvalidationPolicy<OrderUpdated>(e => [$"order:{e.OrderId}"]);
services.AddZoneInvalidationPolicy<OrderUpdated>(e => ["orders"]);
services.AddKeyInvalidationPolicy<OrderUpdated>(e => [$"order:summary:{e.OrderId}"]);
services.AddEntityInvalidationPolicy<OrderUpdated>(
entityName: "order",
idsSelector: e => [e.OrderId],
zonesSelector: e => ["orders"],
keyPrefixes: ["order", "order:summary"]);
Profile-oriented policy shortcuts
// Small website: tag + zone invalidation (lower write amplification)
services.AddSmallWebsiteEntityInvalidationPolicy<OrderUpdated>(
entityName: "order",
idsSelector: e => [e.OrderId],
zonesSelector: e => ["orders"]);
// High traffic site: tag + zone + key invalidation (stronger consistency)
services.AddHighTrafficEntityInvalidationPolicy<OrderUpdated>(
entityName: "order",
idsSelector: e => [e.OrderId],
zonesSelector: e => ["orders"]);
// Desktop app: lightweight key-only invalidation
services.AddDesktopKeyInvalidationPolicy<OrderUpdated>(
keysSelector: e => [$"order:{e.OrderId}"]);
Docs
- Cache invalidation guide: https://github.com/haxxornulled/VapeCache/blob/main/docs/CACHE_INVALIDATION.md
- Cache tags and zones: https://github.com/haxxornulled/VapeCache/blob/main/docs/CACHE_TAGS_AND_ZONES.md
- API reference: https://github.com/haxxornulled/VapeCache/blob/main/docs/API_REFERENCE.md
| 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
- Autofac (>= 9.1.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Options (>= 10.0.7)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.7)
- VapeCache.Abstractions (>= 1.2.22)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on VapeCache.Features.Invalidation:
| Package | Downloads |
|---|---|
|
VapeCache.Features.Search
Typed RediSearch index, projection, query, and invalidation helpers for HASH-backed VapeCache search workloads. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.22 | 110 | 4/26/2026 |
| 1.2.21 | 102 | 4/26/2026 |
| 1.2.20 | 130 | 4/13/2026 |
| 1.2.19 | 106 | 4/12/2026 |
| 1.2.18 | 119 | 3/30/2026 |
| 1.2.17 | 97 | 3/27/2026 |
| 1.2.15 | 124 | 3/19/2026 |
| 1.2.14 | 102 | 3/18/2026 |
| 1.2.13 | 128 | 3/14/2026 |
| 1.2.12 | 124 | 3/14/2026 |
| 1.2.11 | 128 | 3/14/2026 |
| 1.2.10 | 123 | 3/13/2026 |
| 1.2.9 | 130 | 3/12/2026 |
| 1.2.8 | 121 | 3/12/2026 |
| 1.2.7 | 129 | 3/11/2026 |
| 1.2.6 | 120 | 3/11/2026 |
| 1.2.5 | 130 | 3/11/2026 |
| 1.2.4 | 126 | 3/10/2026 |
| 1.2.3 | 116 | 3/10/2026 |
| 1.2.2 | 114 | 3/10/2026 |
Loading failed
See GitHub releases and docs/UPGRADE_NOTES.md for release-specific notes.