amey-thakur/ai-skills/cdn-strategy

Claude Code and agent skill by amey-thakur/ai-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Push work to the edge so requests never touch your origin, using cache headers, invalidation, and origin shielding. Use when origin load is high, global latency is uneven, or a CDN sits in front of your app but barely caches.

Install

npx vskill@latest install amey-thakur/ai-skills/cdn-strategy

SKILL.md

The same SKILL.md was published earlier as amey-thakur/ai-skills/cdn-strategy.

CDN strategy

A CDN only helps for the responses it actually stores. Most origins ship headers that quietly force every request back to the source, so the edge becomes an expensive proxy that adds a hop and caches nothing. The work is making assets and safe responses cacheable, then keeping them fresh.

Method

  1. Read your cache hit ratio before touching config. Pull the edge hit

ratio from your provider (Fastly Fastly-Debug, Cloudflare cf-cache-status, CloudFront X-Cache). Below 80% on static assets means headers, not capacity, are the problem. Fix the misses you can name first.

  1. Separate immutable from mutable at the URL. Fingerprint static assets

(app.4f1a.js) and serve them Cache-Control: public, max-age=31536000, immutable. HTML and API responses get short or zero TTLs. One caching policy per content class, keyed off the path, not per route guesswork.

  1. Split browser TTL from edge TTL. Use s-maxage for the CDN and

max-age for the browser so you can hold a response at the edge for an hour while telling clients to revalidate in a minute. stale-while-revalidate lets the edge serve stale bytes while it refetches in the background.

  1. Invalidate by tag, not by guessing. Attach surrogate keys (Fastly

Surrogate-Key, Cloudflare Cache-Tag) to responses so publishing an article purges article:912 everywhere in one call. Path purges miss query-string and locale variants; tag purges do not.

  1. Turn on origin shielding. Designate one shield POP so the other edge

nodes fetch from it instead of stampeding your origin on a cold cache. This collapses a global miss from hundreds of origin requests to one.

  1. Control the cache key deliberately. Strip tracking query params and

irrelevant cookies from the key, and set Vary only on headers that truly change the body (Accept-Encoding, sometimes Accept-Language). A Vary: Cookie on a public page fragments the cache into uselessness.

Litmus tests

  • Does curl -I on a static asset show a year-long max-age and immutable?
  • After a publish, does the changed page update within one purge call, with

no stale variants left behind?

  • Does a cold-cache spike hit the origin once per shield, not once per POP?
  • Is cf-cache-status (or equivalent) HIT on the paths you expect to cache?

Boundaries

This covers edge caching of HTTP responses. Header semantics themselves belong to the http-caching skill; personalized or auth-gated responses that cannot be shared across users are a compute-at-edge or origin concern, not a caching one. Defer purge-on-deploy wiring to the project's release pipeline.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
10
Repository forks
2
7-day trend score
17

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/amey-thakur/ai-skills/cdn-strategy/badge)](https://verified-skill.com/skills/amey-thakur/ai-skills/cdn-strategy)

Something wrong with this skill or its page? Tell us.