caching

Cache data with HybridCache and stampede protection in .NET applications.

2|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/bingeli1379/eli-claude-marketplace --skill caching-bingeli1379
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caching
Source: https://github.com/bingeli1379/eli-claude-marketplace/tree/main/plugins/eureka-sdd/skills/caching
Command: npx skills add https://github.com/bingeli1379/eli-claude-marketplace --skill caching-bingeli1379

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Caching eliminates repetitive data fetches and reduces database load by serving frequently requested data from in-process and distributed caches.

Core Features & Use Cases

  • HybridCache default abstraction with in-memory and distributed layers and stampede protection.
  • Read-through caching with GetOrCreate patterns and explicit TTLs.
  • Output caching for endpoints and per-endpoint invalidation hooks to maintain consistency.
  • Optional Redis as L2 cache for distributed scenarios and scalability.
  • Clear cache on mutations via RemoveAsync or structured invalidation.

Quick Start

Configure HybridCache in Program.cs and optionally enable Redis, then start using cache.GetOrCreateAsync for your data.

Frequently Asked Questions about caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement caching in ASP.NET Core to reduce database load?

Caching in ASP.NET Core reduces database load by serving frequent requests from in-process and distributed layers. You can use the HybridCache abstraction with GetOrCreate patterns to retrieve data quickly and apply explicit TTLs for freshness.

How does HybridCache stampede protection work for frequently read endpoints?

HybridCache stampede protection prevents cache misses from overwhelming your database on frequently read endpoints. It synchronizes concurrent requests for the same key, ensuring only one fetch populates the cache while others wait for the result.

Can I use Redis as an L2 distributed cache in modern .NET applications?

Yes, you can use Redis as an L2 distributed cache in modern .NET applications. It functions as an optional secondary layer alongside the in-memory L1 cache, providing scalability and shared state across multiple application instances.

What is the best way to invalidate cached data on mutations in ASP.NET Core?

The best way to invalidate cached data on mutations in ASP.NET Core is through deterministic invalidation. You can clear cached data on writes by calling RemoveAsync or using structured invalidation hooks to maintain data consistency.

Does output caching support per-endpoint invalidation in ASP.NET Core?

Yes, ASP.NET Core output caching supports per-endpoint invalidation. It provides specific invalidation hooks that allow you to clear cached responses for individual endpoints, ensuring consistency when underlying data changes.

When should I not use read-through caching for per-item lookups?

You should not use read-through caching for per-item lookups when data mutates frequently or requires strict real-time consistency. If the cache invalidation overhead exceeds the database fetch cost, caching provides no performance benefit.