From grimoire
Designs or audits HTTP caching, CDN configuration, and application-level cache policies for web services.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:design-caching-strategyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Configure cache-control directives and CDN rules to serve assets at maximum speed while keeping content fresh enough to be correct.
Configure cache-control directives and CDN rules to serve assets at maximum speed while keeping content fresh enough to be correct.
Adopted by: Fastly, Cloudflare, and Akamai — serving trillions of requests using these patterns; RFC 7234 is the HTTP/1.1 standard implemented by every browser and CDN globally
Impact: Cloudflare reports CDN cache hits serving responses in <10ms vs. 100-400ms for origin fetches; Facebook's static asset caching strategy (immutable + content-addressed URLs) eliminates cache invalidation for static content entirely
Why best: Caching decisions are permanent performance wins: unlike code optimizations, a correctly cached response costs nothing to serve regardless of origin server load. The strategy must match the content's mutability — aggressive caching of mutable content breaks correctness; conservative caching of immutable content wastes the performance budget.
app.a3f2c.js): Cache-Control: public, max-age=31536000, immutable; the URL changes on content change, so max TTL is safeCache-Control: public, s-maxage=300, stale-while-revalidate=60; CDN serves stale content while fetching fresh in background, eliminating user-visible latency on revalidationCache-Control: private, no-store or Vary: Cookie, Authorization to prevent CDN from serving one user's data to anotherSet-Cookie responses at the CDN layer — session cookies cached and served to wrong users is a security incidentstale-while-revalidate requires a CDN or service worker — browsers alone do not implement background revalidationno-cache when you mean no-store — no-cache still stores and revalidates; no-store never storesCache-Control headers; never rely on CDN defaults, which vary by providerStatic asset: /assets/logo.a1b2c3.png → Cache-Control: public, max-age=31536000, immutable
API response: GET /api/products → Cache-Control: public, s-maxage=60, stale-while-revalidate=30
User dashboard: GET /dashboard → Cache-Control: private, no-store
.json endpoint with user data should not be cached public regardless of extensionmax-age=0 thinking it disables caching: it sets TTL to zero, meaning the resource is immediately stale but still cacheable and revalidatableAccept-Encoding: serving a gzip response to a client that sent no Accept-Encoding breaks parsingno-store must be used with no exceptions.s-maxage and stale-while-revalidate requires CDN infrastructure to take effect; without it, only browser-level caching applies.npx claudepluginhub jeffreytse/grimoire --plugin grimoireConfigures Cache-Control directives and ETags for HTTP endpoints to reduce redundant network round-trips and origin load.
Guides designing CDN architectures, caching strategies, and global content distribution. Covers cache hierarchies, origin shielding, invalidation, and edge optimization.
Implements HTTP caching strategies including Cache-Control directives, ETags, conditional requests, CDN caching for APIs, response compression (gzip/Brotli), HTTP/2, and circuit breakers.