codewithmukesh/dotnet-claude-kit/caching
Claude Code and agent skill by codewithmukesh/dotnet-claude-kit
- community
Checking that the SKILL.md file is still in the repository.
Caching strategies for .NET 10 applications. Covers HybridCache (the default), output caching, response caching, and distributed cache patterns. Load this skill when implementing caching, optimizing read performance, reducing database load, or when the user mentions "cache", "HybridCache", "Redis", "output cache", "response cache", "distributed cache", "IMemoryCache", "cache invalidation", "stampede protection", or "cache-aside".
Install
npx vskill@latest install codewithmukesh/dotnet-claude-kit/cachingSKILL.md
The same SKILL.md was published earlier as codewithmukesh/dotnet-claude-kit/caching.
Caching
Core Principles
- HybridCache is the default — .NET 9+ introduced
HybridCacheas the unified caching abstraction. It combines in-memory (L1) and distributed (L2) caching with stampede protection. See ADR-004. - Cache reads, not writes — Cache GET operations. Invalidate on mutations. Never cache POST/PUT/DELETE responses.
- Output caching for entire responses — When the full HTTP response can be cached (public APIs, static data), use output caching middleware.
- Set explicit TTLs — Every cached item needs an expiration. No unbounded caches.
Patterns
HybridCache (Recommended Default)
Cache Invalidation
Output Caching (Full Response Caching)
Cache-Aside Pattern (Legacy)
Prefer HybridCache for all new code. ManualIDistributedCachecache-aside lacks stampedeprotection, requires manual serialization, and has no L1/L2 layering. Use only whenintegrating with existing code that already usesIDistributedCachedirectly.
Anti-patterns
Don't Cache Without Expiration
Don't Cache Mutable User-Specific Data
Don't Build Your Own Stampede Protection
Decision Guide
| Scenario | Recommendation | |
|---|---|---|
| General data caching | HybridCache (GetOrCreateAsync) | |
| Full HTTP response | Output caching with .CacheOutput() | |
| Frequently read, rarely written | HybridCache with longer TTL | |
| User-specific data | HybridCache with user-scoped key | |
| Cache invalidation on write | cache.RemoveAsync() or output cache tags | |
| Distributed deployment | HybridCache + Redis L2 backend | |
| Single-server deployment | HybridCache with in-memory only |
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/caching/SKILL.md
Popularity
- Repository stars
- 727
- Repository forks
- 171
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Sep 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/codewithmukesh/dotnet-claude-kit/caching)