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" />
                    
Directory.Packages.props
<PackageReference Include="VapeCache.Features.Invalidation" />
                    
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 VapeCache.Features.Invalidation --version 1.2.22
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=VapeCache.Features.Invalidation&version=1.2.22
                    
Install as a Cake Tool

VapeCache.Features.Invalidation

Optional policy-driven invalidation package for VapeCache.

What it adds

  • CacheInvalidationPlan and CacheInvalidationPlanBuilder
  • ICacheInvalidationPolicy<TEvent> with built-in policy implementations
  • ICacheInvalidationExecutor to apply plans to IVapeCache
  • ICacheInvalidationDispatcher to 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 overhead
  • HighTrafficSite: strict and concurrent execution
  • DesktopApp: conservative best-effort behavior

You can override profile defaults with:

  • ThrowOnFailure
  • ExecuteTargetsInParallel
  • EvaluatePoliciesInParallel
  • MaxConcurrency

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

Product 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.

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.