netlify-caching

Configure CDN cache headers, cache tags, and on-demand purging for Netlify deployments.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-caching-syedarmanali2003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-caching
Source: https://github.com/SyedArmanAli2003/AgroNaV/tree/main/.agents/skills/netlify-caching
Command: npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-caching-syedarmanali2003

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @netlify/functions.

What problem does it solve? Dynamic responses from Netlify Functions and edge functions are not cached by default, forcing developers to manually configure cache headers, invalidation strategies, and cache key variation to control CDN behavior. ## Core Features & Use Cases - Cache Header Configuration: Set Netlify-CDN-Cache-Control, CDN-Cache-Control, and Cache-Control headers for CDN-only, multi-CDN, or browser caching patterns including stale-while-revalidate and durable cache. - Tag-Based Purging: Tag responses with Netlify-Cache-Tag and purge them on demand using the purgeCache API from @netlify/functions, or purge the entire site cache. - Framework Guidance: Apply caching patterns specific to Next.js ISR, Astro, Remix, Nuxt, and Vite SPAs, plus debug cache behavior using the Cache-Status response header. - Use Case: A developer building a product listing API on Netlify Functions can cache responses at the CDN for 24 hours, tag them with "product", and purge only those entries when inventory changes instead of redeploying. ## Quick Start Ask the assistant to configure CDN caching with stale-while-revalidate and tag-based purging for a Netlify Function endpoint.

Frequently Asked Questions about netlify-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I cache Netlify Function responses on the CDN?

Set the Netlify-CDN-Cache-Control header on your function response, for example "public, s-maxage=3600, must-revalidate". Dynamic responses are not cached by default, so explicit headers are required for CDN caching.

How to purge the Netlify cache on demand?

Import purgeCache from @netlify/functions and call it with specific tags, such as purgeCache({ tags: ["product"] }), or call it without arguments to purge the entire site. Tagged responses are excluded from automatic deploy-based invalidation.

What is the difference between Netlify-CDN-Cache-Control and Cache-Control?

Netlify-CDN-Cache-Control applies only to Netlify's CDN and is stripped before reaching the browser, while Cache-Control is seen by browsers and all intermediate caches. Use both together to cache at the CDN while forcing browsers to revalidate.

Does Netlify caching work with Next.js ISR?

Yes, Next.js ISR uses Netlify's durable cache automatically with runtime 5.5.0 or later. The revalidatePath and revalidateTag functions trigger cache purges without manual header configuration.

Why is my Netlify site not caching responses?

Common causes include basic auth being enabled, which disables caching site-wide, missing cache headers on dynamic responses, or inconsistent Netlify-Vary headers. Check the Cache-Status response header for HIT, MISS, or REVALIDATED values.

What are the limitations of Netlify durable cache?

Durable cache is available only for serverless functions, not edge functions. Additionally, the same URL must return identical Netlify-Vary headers across responses, and deploy invalidation is scoped to the deploy context.