cdn-cache-control
JSON →A subclass of the fetch Headers class that simplifies setting Cache-Control and CDN-specific cache headers for modern CDNs. Version 1.3.1 supports Netlify, Vercel, Cloudflare, and Akamai with automatic platform detection. It provides a chainable API with sensible defaults (CDN cache for 1 year, browser revalidation) and methods like `ttl()`, `swr()`, and `immutable()`. Unlike raw header manipulation, it abstracts CDN-specific quirks and promotes best practices like stale-while-revalidate and surrogate keys. Ships TypeScript types. Released as an npm package and JSR module.
Resources
packagecdn-cache-control ↗
API endpoints
full doc /v1/registry/cdn-cache-control