Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.03 KB

File metadata and controls

26 lines (17 loc) · 1.03 KB

CleverCache

Automatic cache invalidation for .NET — tracks entity changes via EF Core and clears related cache entries automatically.

Supports memory cache (default), distributed cache (IDistributedCache), or a custom provider.

For full documentation, examples, and configuration options see the CleverCache wiki.

See also:

Quick start

// Memory cache (default)
builder.Services.AddCleverCache();

// Distributed cache (e.g. Redis)
builder.Services.AddStackExchangeRedisCache(o => o.Configuration = "localhost");
builder.Services.AddCleverCache(o => o.UseDistributedCache());

// Custom provider
builder.Services.AddCleverCache(o => o.UseCustomStore<MyStore>());

By default, cache entries use a 4 hour sliding expiration. Change the global default with CleverCacheOptions.DefaultEntryOptions, or override an individual MediatR query with [AutoCache(...)] expiration properties.