caching

caching is a skill for Claude Code from zdanovichnick/dotnet-pilot. It costs 35 tokens per session (608 once invoked), scanned A, original, MIT.

A reference guide to caching in .NET, which means temporarily storing data or web responses so they can be returned faster. It covers HybridCache, output caching, cache-aside, and in-memory caching.

In plain words
What is it for?
Use it when caching application data, HTTP responses, computed results, sessions, or distributed data in .NET APIs.
Why use it?
It helps developers choose and configure the right cache while handling key design, invalidation, and repeated simultaneous requests.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the dotnet-pilot plugin — 15 skills, 9 agents, 6 hooks, 1 MCP server shipped together

Good fit Use it when caching application data, HTTP responses, computed results, sessions, or distributed data in .NET APIs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zdanovichnick/dotnet-pilot/caching
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zdanovichnick/dotnet-pilot --skill caching
Clone the repo
git clone --depth 1 https://github.com/zdanovichnick/dotnet-pilot

Made for: Claude Code.

Or install dotnet-pilot, the plugin that ships this one along with the rest of its 15 skills, 9 agents, 6 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for caching

README.md
[![agentmods](https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/caching/github.svg)](https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/caching)
Your own site
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/caching"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/caching/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for caching

Your own site · 80×15
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/caching"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 608 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.00608
Opus 5.5 $0.00014 $0.00243
Sonnet 5.5 $0.00007 $0.00122
Haiku 4.5 $0.00003 $0.00061

Measured 1mo ago against content hash 3aa518bb1dab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

caching scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/caching/SKILL.md · 46 lines

How it starts

The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Caching Patterns

Reference for caching in .NET APIs. Covers HybridCache (L1+L2), output caching, cache-aside, and IMemoryCache.

Caching Options at a Glance

Option Best For Notes
HybridCache Application-level data (entities, computed results) .NET 9+; L1 in-process + L2 distributed; stampede protection
Output caching (IOutputCacheStore) HTTP response caching (full responses) Middleware-level; [OutputCache] attribute or .CacheOutput()
IMemoryCache Single-node, simple key-value, no distributed requirement No stampede protection; use GetOrCreateAsync
IDistributedCache Distributed session, custom serialization Low-level; HybridCache wraps it

References

Load only the file the task needs:

File Covers
references/hybridcache.md Package, registration, usage, invalidation, typed cache keys
references/output-cache.md Output-cache registration, [OutputCache] / .CacheOutput() usage, invalidation
references/cache-aside-and-keys.md Cache-aside pattern, IMemoryCache for single-node apps, multi-tenant key strategy

Do / Don't

Do Don't
Use HybridCache as the default for application data Use IMemoryCache in a multi-node deployment for shared data
Always set an expiration Cache indefinitely (memory leak, stale data)
Use typed key factory to avoid magic strings Scatter $"product:{id}" literals across the codebase
Cache sealed, immutable DTOs (see the reuse gotcha in references/hybridcache.md) Cache tracked EF entities or mutable objects (mutations won't propagate)
Scope keys by tenant ID in multi-tenant apps Share cache entries across tenants
Log cache misses at Debug level Log every cache hit (too noisy)
Invalidate on write (cache-aside write-through) Let stale data live beyond TTL without a manual eviction path
Use tags for group invalidation Enumerate and delete keys by prefix (fragile, slow)

Read the full file on GitHub · 46 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -223 lines 3aa518bb1dab
  2. 1mo ago First seen · 269 lines · 35 tokens per session scan A 46ef05b9e247

Subscribe to this mod's changes

caching is a skill published in the GitHub repository zdanovichnick/dotnet-pilot (5 stars, last pushed 19d ago), licensed MIT. It adds 35 tokens to every session and 608 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

nextjs-cache-architecture

Use this skill whenever the user wants to design or implement caching in a Next.js 16+ App Router project — setting up the "use cache" directive, building a cache tag registry, wiring mutations to invalidation utilities, structuring Suspense boundaries for partial prerendering, handling personalized content near cache…

mohamed-hossam1/nextjs-skills · 127 tokens

azure-resource-manager-redis-dotnet

Azure Resource Manager SDK for Redis in .NET. Use for MANAGEMENT PLANE operations: creating/managing Azure Cache for Redis instances, firewall rules, access keys, patch schedules, linked servers (geo-replication), and private endpoints via Azure Resource Manager. NOT for data plane operations (get/set keys, pub/sub) …

microsoft/skills · 114 tokens

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens

bun-redis

Use when working with Redis in Bun (ioredis, Upstash), caching, pub/sub, session storage, or key-value operations.

secondsky/claude-skills · 32 tokens

redis-best-practices

Redis development best practices for caching, data structures, and high-performance key-value operations.

Mindrally/skills · 22 tokens

database-expert

Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.

travisjneuman/.claude · 36 tokens