Skip to content

version-switcher: fetch switcher.json fresh (bypass cache)#5

Merged
coretl merged 1 commit into
mainfrom
switcher-cache-bypass
Jun 19, 2026
Merged

version-switcher: fetch switcher.json fresh (bypass cache)#5
coretl merged 1 commit into
mainfrom
switcher-cache-bypass

Conversation

@coretl

@coretl coretl commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

switcher.json changes every deploy, but GitHub Pages serves it with
Cache-Control: max-age=600, so the dropdown could show a version list up to
~10 min stale (a new pr-/release wouldn't appear without a hard reload).
Bust both layers: a unique query string forces a CDN-edge miss → origin, and
cache: "no-store" stops the browser serving its own copy. The file is tiny, so
always-fresh is cheap.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

switcher.json changes every deploy, but GitHub Pages serves it with
Cache-Control: max-age=600, so the dropdown could show a version list up to
~10 min stale (a new pr-<n>/release wouldn't appear without a hard reload).
Bust both layers: a unique query string forces a CDN-edge miss → origin, and
cache: "no-store" stops the browser serving its own copy. The file is tiny, so
always-fresh is cheap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coretl coretl merged commit d1843df into main Jun 19, 2026
4 checks passed
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