Skip to content

fix: add no-cache header to index.html#66

Merged
rubenhensen merged 1 commit into
mainfrom
fix/cache-control-index-html
Apr 3, 2026
Merged

fix: add no-cache header to index.html#66
rubenhensen merged 1 commit into
mainfrom
fix/cache-control-index-html

Conversation

@rubenhensen

@rubenhensen rubenhensen commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Cache-Control: no-cache to the catch-all location / block that serves index.html
  • This ensures browsers always revalidate index.html with the server, so new deployments are picked up immediately
  • Cached responses still benefit from 304 Not Modified when unchanged (no re-download)

Problem

The index.html entry point had no Cache-Control header, so browsers could use heuristic caching and serve a stale version. After a deployment, the stale index.html would reference old hashed JS/CSS filenames that no longer exist, causing 404 errors and blank screens.

Test plan

  • Deploy and verify index.html response includes Cache-Control: no-cache header
  • Verify hashed assets (JS/CSS) still return Cache-Control: public with 1-year expiry
  • Confirm that after a new deployment, refreshing the page loads the new version without needing a hard refresh

…loaded

The catch-all location block serving index.html had no Cache-Control
header, allowing browsers to use heuristic caching. This could cause
stale index.html to reference old hashed assets after a deployment,
resulting in 404 errors and blank screens.

Adding no-cache ensures browsers always revalidate index.html with the
server while still benefiting from 304 responses when unchanged.
@rubenhensen rubenhensen merged commit 5ddaf9e into main Apr 3, 2026
4 checks passed
@rubenhensen rubenhensen deleted the fix/cache-control-index-html branch April 3, 2026 14:24
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