agentleFS
shinzoxDshinzoxD/knackbox/skills/coding/caching-strategies/SKILL.md

caching-strategies

Skill0 starsChanged 5 months agoApache-2.0View on GitHub

Design caching layers with correctness, TTLs, invalidation, and

9 other projects use a version of this.

Adopted by

Most recently taken up by

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 7 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:

    Read pattern, freshness needs, and blast radius of stale data.

    line 21
  2. Distinctive:

    Prefer explicit invalidation for user-visible mutations.

    line 44
  3. Distinctive:

    Document what clients may see stale.

    line 45
  4. Distinctive:

    Do not invent Redis commands incorrectly — describe intent.

    line 47

“Common” is measured: kept by at least 6 in 10 of the 7 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

Cache for latency and cost, not as a second source of truth without a plan. Name the consistency model and invalidation path.

Workflow

  1. Read pattern, freshness needs, and blast radius of stale data.
  2. Layer: browser, CDN, app memory, Redis, DB.
  3. Key design and TTL; avoid unbounded key growth.
  4. Invalidation: TTL-only vs event-driven vs write-through.
  5. Stampede: singleflight, soft TTL, probabilistic early expire.
  6. Negative caching for misses.
  7. Metrics: hit ratio, latency, error on cache path.

Output format

## Cache design: <surface>
**Consistency:** …
**Keys / TTL:** …
**Fill path:** …
**Invalidate:** …
**Stampede control:** …
**Failure mode:** …

Rules

  1. Security: never cache authorized personal data under shared keys.
  2. Prefer explicit invalidation for user-visible mutations.
  3. Document what clients may see stale.
  4. Measure before multi-layer complexity.
  5. Do not invent Redis commands incorrectly — describe intent.

Edge cases

  • CDN + auth: private vs public.
  • Multi-region: replication lag.
  • Search indexes: near-cache vs source of truth.

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.