Netlify Caching
Netlify CDN caching controls for function and edge responses, including headers, purges, and the Cache API.
- CCM score
- 77 of 100
- skills.sh installs
- 3.5K
- GitHub stars
- 57
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers
Netlify-CDN-Cache-Controldirectives,Netlify-Varycache-key rules, cache tags, and durable caching for serverless functions - Includes on-demand purging by site or tag via
purgeCache, the purge REST endpoint, and the programmaticcachesCache API - Enforces that static assets stay fresh up to a year and
durablehas no effect on Edge Function responses - Designed for developers adding caching or invalidation to Netlify Functions, Edge Functions, or proxied API responses
Install
$ npx -y skills add netlify/context-and-tools --skill netlify-caching -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Netlify caching
Cache-control header to reach for
Dynamic responses (Functions, Edge Functions, Netlify Server, proxies) are NOT cached by default. You must opt in. Set Netlify-CDN-Cache-Control on the response:
import type { Context } from "@netlify/functions";
export default async (req: Request, context: Context) => {
return new Response("Hello world", {
headers: {
'Netlify-CDN-Cache-Control': 'public, durable, max-age=60, stale-while-revalidate=120'
}
});
};
Header choice (most specific wins; CDN-Cache-Control/Cache-Control always pass downstream):
Netlify-CDN-Cache-Controlapplies to the Netlify CDN only. Reach for this.CDN-Cache-Controlapplies to all CDNs that support it.Cache-Controlapplies to any CDN or the browser.
Legacy path to avoid: On-demand Builders do not support these headers or Netlify-Vary. They use a TTL pattern and key on URL path only. Don't reach for ODBs in new code.
Footguns (read first)
Details
- Repository
- github.com/netlify/context-and-tools
- Categories
- Backend & APIs, DevOps & Cloud
- First seen
- Jun 3, 2026
Questions
What does the netlify-caching skill help with?
The netlify-caching skill guides you on controlling caching on Netlify's CDN for functions, edge functions, and Netlify Server responses. It covers Netlify-CDN-Cache-Control headers, stale-while-revalidate, cache tags, purging, the durable cache, and the programmatic Cache API.
How do I install the netlify-caching skill?
Run npx -y skills add netlify/context-and-tools --skill netlify-caching -y in your project. After that, the agent can apply Netlify caching patterns such as cache headers, cache key variation, and on-demand purges to your code.
Why is my Netlify function response not being cached?
Dynamic responses from functions are not cached by default, so you must set a Netlify-CDN-Cache-Control header to opt in. The skill also explains reading the Cache-Status header to debug whether a response is cached.
Where does netlify-caching stand in the Backend & APIs category?
The netlify-caching skill is listed in the Backend & APIs category on Claude Marketplaces. Its focus on CDN cache control, purging, and cache tags sets it apart from general API skills in that category.
More from netlify/context-and-tools
All 12Similar to Netlify Caching
More Backend & APIsnetlify-blobsnetlify/context-and-tools3.5K installsNetlify Blobs storage guide for files, assets, and cached binaries, with deploy-scoped and site-wide store options.
netlify-edge-functionsnetlify/context-and-tools3.5K installsEdge-runtime handlers for Deno, with routing, rewrites, middleware, caching, and geolocation guidance.
caching-cdn-strategy-plannerpatricio0312rev/skills263 installsMulti-layer caching strategy covering CDN edge, Redis server cache, invalidation, and HTTP cache headers.
vercel-networking-domainsbobmatnyc/claude-mpm-skills371 installsVercel networking reference for domains, DNS, redirects, rewrites, headers, CDN, edge cache, and regions.