agentleFS
cookieMonsterDevcookieMonsterDev/agents-skills/skills/architecture/caching-strategies/SKILL.md

caching-strategies

Skill7 starsChanged 16 days agoMITView on GitHub

Review, diagnose, and improve application and HTTP caching. Use when designing a cache, investigating stampedes or stale reads, reviewing cache isolation and invalidation, or reducing cache-related origin load. For command syntax alone, use the cache product's documentation.

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use observability and api-design.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 3 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat a cache as a replica with a freshness contract and a failure mode.

    line 8
  2. Distinctive:

    Trace the lifecycle: Follow a fresh hit, stale hit, absent/evicted entry, concurrent fill, committed write, and dependency failure across …

    line 19
  3. Distinctive:

    Choosing cache placement or write policy: read strategies.

    line 37
  4. Distinctive:

    Checking whether an agent applies these rules correctly: use the synthetic review scenarios.

    line 47

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Caching Strategies

Treat a cache as a replica with a freshness contract and a failure mode. Recommend it for a demonstrated reuse or latency benefit; a simpler query, index, or no cache can be the right outcome.

Workflow

  1. Establish the contract. For the affected read path, identify the authoritative store, cache layers, key dimensions, readers and writers, deployment topology, tolerated staleness, and origin capacity. Trace actual code and configuration; separate measured facts from assumptions. Ask only for unknown requirements that change the design, such as whether stale authorization decisions are allowed.
  2. Trace the lifecycle. Follow a fresh hit, stale hit, absent/evicted entry, concurrent fill, committed write, and dependency failure across the affected layers. Include background jobs and other services that write the same data. Finish when each transition has an owner and observable behavior, or a named gap.
  3. Read the matching references below. For a broad caching review, cover every applicable branch; for a focused incident, follow its causal path. Verify version-specific commands and library guarantees in official product docs.
  4. Choose the smallest correction. Explain the failure sequence, the invariant the change restores, and its latency, freshness, capacity, and complexity costs. A review produces findings; implement only when the request includes changes.
  5. Verify the contract. Exercise the affected interleavings with controlled clocks/barriers and representative concurrency. Compare origin calls, tail latency, stale age, refresh errors, and rejected requests against explicit bounds. Distinguish proposed tests from checks actually run; a warm-cache hit ratio alone does not demonstrate correctness or outage tolerance.

Routing

  • Choosing cache placement or write policy: read strategies.
  • One hot key expires, concurrent cold misses, or refresh owners fail: read stampede prevention.
  • Old values reappear after writes, missed invalidations, or several cache layers: read invalidation and consistency.
  • Wrong user's result, ambiguous keys, personalized HTTP responses, or repeated lookups of missing records: read keys and isolation.
  • Many keys expire, cache outage, eviction churn, or a hot shard: read capacity and failure.
  • Checking whether an agent applies these rules correctly: use the synthetic review scenarios.

Findings and completion

For each actionable finding, provide: severity and impact, file/configuration evidence, a concrete request or event sequence, the smallest fix with its trade-off, and a verification criterion. Mark unverified hypotheses as validation gaps.

For an implementation, also report the changed contract, checks actually run, and rollout/recovery implications. Account for old cache payloads and mixed application versions; changing a key namespace can create a cold-cache traffic surge. Finish when every in-scope failure has a supported finding, a verified correction, or an explicit remaining limitation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.