Caching strategies
Skill kimtth/agent-skill-100-lines-or-less/skills/caching-strategies
🧿 Minimal but effective AI agent skill definitions in 100 lines or less.
npx -y skills add kimtth/agent-skill-100-lines-or-less --skill caching-strategiesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when: add caching with the right layer, key design, invalidation, and consistency trade-offs.
SKILL.md
1.1 KB, as published. Nobody here has run it
Goal: caching that speeds reads without serving wrong data.
Use for:
- reducing latency or load on expensive operations
- choosing where and how long to cache
- fixing stale or inconsistent cached data
Workflow:
- Identify the read hot path worth caching.
- Choose the layer: in-memory, distributed, CDN, or HTTP.
- Design stable cache keys that capture all inputs.
- Set TTLs by tolerance for staleness.
- Define invalidation: on write, by tag, or by expiry.
- Measure hit rate and verify correctness under updates.
Patterns:
- cache-aside (read-through) for most workloads
- write-through/write-behind when writes dominate
- tag or key-based invalidation on mutations
- stampede protection (locks, jitter) on hot keys
Rules:
- never cache user-specific or secret data in shared caches
- invalidate on the write that changes the source
- include every input that affects the result in the key
- prefer short TTLs over clever invalidation when unsure