Skip to content
Skills Library
DevOps & cloud · Planning

cdn-strategy

/cdn-strategy

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.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

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.

Original author description

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.

How it works

  1. Method
  2. Litmus tests
  3. Boundaries
Original SKILL.md headings · 51 lines, 415 words
SKILL.md preview
---
name: cdn-strategy
description: 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.
---

# 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.
2. **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.
3. **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.
4. **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.
5. **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.
6. **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.

Versions

The database has no other skills named cdn-strategy.

Database snapshot: 13.11.2026 · package version 980f7acd76e5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90edge-cdn
    Design a CDN configuration — caching rules, TTLs, and origin shield setup. Use when asked to "configure the CDN", "set cache headers", or "set up an origin shield".
  • 100cdn
    Covers caching and serving content at the edge — cache keys and TTL design, invalidation strategies, origin shielding, deciding what is safely cacheable, and moving static and dynamic content closer to users. Use this whenever the user is configuring a CDN, choosing…
  • 90content-delivery
    This skill should be used when the user asks about a "CDN", "edge caching", "static asset delivery", "media / video delivery", "geo distribution of content" or "edge POP selection", "push vs pull CDN", "cache-control headers" / "TTL for static assets", "origin offload", or…
  • 100ttfb
    Use when auditing slow first responses on SSR pages, APIs, or cacheable HTML. Distinguish origin compute time from network latency and CDN cache misses before proposing a fix.
  • 100huawei-cloud-cdn-origin-diagnosis
    Diagnose CDN origin server reachability and back-to-source failures using hcloud CLI. Query the origin configuration (origin_addr, origin_type, http_port, https_port, origin_protocol) of a CDN domain via ShowDomainFullConfig/v2, then probe origin server connectivity using the…
  • 95cache-strategy
    Cache patterns for Redis, CDN, TTL, and invalidation. Use for architecture decisions on caching strategies.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.