Revalidating Server Content

This is a server-rendered page, last created at Sat, 18 May 2024 06:44:22 GMT with a few extra response headers:

{
  "Cache-Control": "public, max-age=0, must-revalidate",
  "Netlify-CDN-Cache-Control": "public, max-age=31536000, must-revalidate",
  "Cache-Tag": "/revalidation,cats-related,all-pets-related"
}

Meaning: for browsers, this is a non-cacheable page. At the CDN level, it is cacheable for up to a year (and Netlify also automatically busts the cache on new deployments, by default).

But there's something more: the Cache-Tag header, in tandem with the purge API, allows a developer to invalidate at will any pieces of content (pages, JSON responses, or whatnot) based on the tags associated with them. Tags are completely up to you to decide on, and allow for very powerful patterns.

In real-world applications, you may want to use stale-while-revalidate as well, so that end-users don't experience a performance hit as pages are being rebuilt.

Use the button below to invlidate a random tag out of this page's tags, then refresh the page.