netlify-caching

Configure and validate Netlify CDN and browser caching headers.

32|7|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/netlify/context-and-tools --skill netlify-caching-netlify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-caching
Source: https://github.com/netlify/context-and-tools/tree/main/codex/skills/netlify-caching
Command: npx skills add https://github.com/netlify/context-and-tools --skill netlify-caching-netlify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Optimize and validate CDN and browser caching on Netlify to improve site performance and ensure correct content invalidation across assets, routes, and responses.

Core Features & Use Cases

  • Configure and validate Netlify-CDN-Cache-Control, CDN-Cache-Control, and Cache-Control headers to control where and how content is cached.
  • Rely on default asset caching for static files and explicitly define caching for dynamic responses (functions and edge routes) with on-demand purge when content updates.
  • Use Netlify-Cache-ID for tagging and selective cache purges to invalidate specific content without deploying a full site.
  • Apply framework-specific caching patterns (Next.js ISR, Astro/Remix, Nuxt, Vite SPA) to align with your hosting stack.

Quick Start

Apply a CDN-only caching policy on static assets by setting Netlify-CDN-Cache-Control to public, max-age=31536000, immutable.

Frequently Asked Questions about netlify-caching

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

FAQPage Schema
How do I configure Netlify CDN caching headers for static assets and dynamic routes?

Netlify-CDN-Cache-Control, CDN-Cache-Control, and Cache-Control headers differ by caching layer: Netlify-CDN-Cache-Control targets the Netlify CDN specifically, CDN-Cache-Control applies to upstream CDN layers, and standard Cache-Control dictates browser caching behavior for static assets and dynamic responses.

How do I purge cached content on Netlify without triggering a full site deployment?

To purge cached content on Netlify without a full deployment, use Netlify-Cache-ID for tagging and perform on-demand purges. This allows selective invalidation of specific dynamic responses or assets, ensuring updated content is served immediately without redeploying the entire site.

Does Netlify CDN caching work with framework-driven deployments like Next.js and Astro?

Netlify CDN caching works with framework-driven deployments like Next.js ISR, Astro, Remix, Nuxt, and Vite SPA. It applies framework-specific caching patterns to align with your hosting stack, ensuring correct cache behavior for static generation, edge functions, and dynamic routes.

What is the best way to cache dynamic responses from Netlify serverless functions?

The best way to cache dynamic responses from Netlify functions is explicitly defining CDN caching headers on server responses. Apply Netlify-CDN-Cache-Control to control edge caching and use on-demand purge to invalidate content when underlying data updates, bypassing default static asset rules.