caching

Implement HybridCache caching strategies for .NET read paths and HTTP responses.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/shahdanish/vibepos --skill caching-shahdanish
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caching
Source: https://github.com/shahdanish/vibepos/tree/main/skills/caching
Command: npx skills add https://github.com/shahdanish/vibepos --skill caching-shahdanish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you speed up read-heavy .NET applications by reducing repeated database work and preventing cache stampedes that can overload your system.

Core Features & Use Cases

  • HybridCache (default): Use .NET’s unified caching abstraction with built-in stampede protection for general cached reads.
  • Cache-aside with invalidation: Cache GET/query results and explicitly invalidate or remove entries after writes to keep data consistent.
  • Output caching: Cache entire HTTP responses for public/static API data to improve throughput when full responses are safe to cache.
  • Redis/distributed patterns: Extend caching across deployments using a distributed L2 backend while keeping the same HybridCache approach.

Quick Start

Ask the assistant to generate a HybridCache-based handler for retrieving a product by ID with a defined TTL and a corresponding cache invalidation step after updates.

Frequently Asked Questions about caching

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

FAQPage Schema
How do I implement cache-aside with safe invalidation in .NET?

Use HybridCache GetOrCreate for cached reads with explicit expiration, then invalidate entries on mutations to keep data consistent. This reduces database load while ensuring stale data is cleared following writes.

What is HybridCache and how does it prevent cache stampedes in .NET?

HybridCache is .NET's unified caching abstraction that includes built-in stampede protection to prevent multiple concurrent requests from overwhelming a database. It coordinates concurrent identical requests so only one fetch occurs, reducing repeated database work.

How do I cache HTTP responses in a .NET Web API?

Cache HTTP responses in .NET using optional output-cache policies with tag-based eviction. This caches entire HTTP responses for public or static API data to improve throughput when full responses are safe to cache.

Can I use Redis as a distributed L2 cache backend with HybridCache?

Yes, you can extend caching across deployments using Redis as a distributed L2 backend while maintaining the same HybridCache approach. This enables distributed caching patterns for read-heavy .NET applications requiring scale.

How do I set up cache expiration and tag-based eviction for .NET output caching?

Set up output caching by defining optional output-cache policies with explicit expiration and tag-based eviction. This allows targeted cache invalidation by clearing groups of cached responses associated with specific tags.

When should I not use output caching for my .NET API responses?

Avoid output caching when full HTTP responses are not safe to cache, such as highly user-specific or rapidly changing data. Use HybridCache for read paths instead, applying explicit expiration and safe invalidation on mutations.