skills/council/tuner/caching-strategy/SKILL.md
Use when designing or auditing a caching architecture. Covers multi-layer cache hierarchy, key schema, TTL policies, invalidation flows, and warming strategies. Do not use for runtime performance profiling (use performance-audit) or capacity planning (use load-modeling).
npx skillsauth add dtsong/my-claude-setup caching-strategyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Design a multi-layer caching architecture that minimizes latency and server load while maintaining data freshness. Produces a cache hierarchy diagram, key schema, TTL policy table, and invalidation flow for each cacheable resource.
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Inventory all resources served by the application:
For each resource, document the read:write ratio and acceptable staleness window.
Define what is cached at each layer, from closest to the user outward:
Document which layer is the primary cache for each resource type.
Design consistent, collision-free cache keys:
page:blog:slug:v2:locale:en)page:blog:*)Assign time-to-live values based on staleness tolerance:
Document TTL as both max-age and s-maxage where CDN behavior differs from browser.
Define how stale cache entries are removed or refreshed:
Map each resource to its invalidation method. Document the mutation-to-purge flow.
Design graceful degradation for cache misses:
stale-while-revalidate? Define the stale window.Cache-Control header construction for each resource classPlan for empty caches after deployments, CDN purges, or scaling events:
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.
# Caching Strategy: [Application Name]
## Cache Hierarchy
[User] → Browser Cache → CDN/Edge → App Cache → DB Query Cache → [Database]
| Layer | Resources Cached | TTL Range | Invalidation |
|-------|-----------------|-----------|-------------|
| Browser | ... | ... | ... |
| CDN/Edge | ... | ... | ... |
| Application | ... | ... | ... |
| DB Query | ... | ... | ... |
## Cache Key Reference
| Resource Type | Key Pattern | Variants | Example |
|--------------|-------------|----------|---------|
| ... | ... | ... | ... |
## TTL Policy Table
| Resource | Browser max-age | CDN s-maxage | stale-while-revalidate | Rationale |
|----------|----------------|-------------|----------------------|-----------|
| ... | ... | ... | ... | ... |
## Invalidation Flows
### [Resource Type]
1. Mutation occurs in [source]
2. [Event/webhook] triggers cache purge
3. [Layer] invalidates entries matching [pattern]
4. Next request triggers revalidation
## Cache Warming Plan
| Resource | Method | Trigger | Priority |
|----------|--------|---------|----------|
| ... | ... | ... | ... |
## Cache-Control Headers
| Route Pattern | Cache-Control Value |
|--------------|-------------------|
| ... | ... |
development
Use when the council needs to surface organizational knowledge buried across multiple internal sources (wikis, design docs, ADRs, past tickets, postmortems, chat archives, code repos). Plans where to look, what to cross-reference, and how to synthesize findings into evidence the council can act on. Do not use for external market research (use competitive-analysis), library evaluation (use library-evaluation), or technology trend assessment (use technology-radar).
testing
Use to convert a Word .docx file to PDF and/or verify its page count. Triggers on: converting docx to pdf, rendering a document, checking how many pages a docx produces, or asserting a page-count constraint (e.g. a resume must stay 2 pages). Wraps LibreOffice headless conversion.
development
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
development
Interactive wizard to craft effective prompts using Claude Code best practices