What problem does it solve?
Caching in .NET often becomes inconsistent or error-prone, leading to stale data, cache stampedes, and scattered key strings that are hard to invalidate correctly.
Core Features & Use Cases
- HybridCache for application data: Use HybridCache (.NET 9+) to combine L1 and optional L2 caching with built-in stampede protection.
- Output caching for HTTP responses: Cache full middleware-level responses using policies and vary rules for query parameters.
- Cache-aside and IMemoryCache support: Use cache-aside when you need manual control, or IMemoryCache for simple single-node scenarios.
- Reliable invalidation with tags and key strategy: Invalidate single entries or groups via tags and enforce typed, tenant-scoped key factories to prevent data leakage.
Quick Start
Configure HybridCache with sensible expiration and use typed cache keys for your entity lookups, then call GetOrCreateAsync to automatically load on cache misses and stay consistent via tag-based invalidation.