Skip to content

Say what Pages actually does with the cache headers - #6

Merged
cobanov merged 1 commit into
mainfrom
fix/pages-cache-note
Aug 30, 2026
Merged

Say what Pages actually does with the cache headers#6
cobanov merged 1 commit into
mainfrom
fix/pages-cache-note

Conversation

@cobanov

@cobanov cobanov commented Aug 30, 2026

Copy link
Copy Markdown
Owner

The _headers file I added carried per-path Cache-Control rules. Measured after deploying: the CSP arrives on every response, the cache header does not, because Cloudflare Pages serves static assets at a fixed max-age=14400.

The version query on style.css and app.js is what actually invalidates them, and index.html is served with max-age=0, so a bumped query is picked up on the next visit. _headers now documents that rather than carrying rules that do nothing; the security headers and the CSP stay.

Measured after deploying: the CSP in _headers arrives on every response, the
Cache-Control does not, because Pages fixes static assets at four hours. The
version query on style.css and app.js is what actually invalidates them, so
_headers now says that instead of carrying rules that do nothing.
@cobanov
cobanov merged commit dd5c92f into main Aug 30, 2026
11 checks passed
@cobanov
cobanov deleted the fix/pages-cache-note branch August 30, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant