Documentation

Caching

Keep visitors up to date, with caching handled for you.

You don’t need to clear a cache after updating your site. By default, browsers check for updates before reusing a saved file. When a file is unchanged, they can reuse their copy without downloading it again.

Cloudflare’s global network helps deliver your files close to your visitors. Caching works automatically, so most sites can use the defaults.

Cache files with versioned names for longer

If your build gives files fingerprinted names, such as app.4f9c2b.css, the name changes whenever the content does, so browsers can safely keep those files for a year. Set that in _headers. Never do it for HTML pages, or for any file whose name stays the same between builds.

_headers
/assets/*
  Cache-Control: public, max-age=31536000, immutable

Last updated 11 September 2026