fix: update S3 cache rule for index.html#2761
Open
rmnbrd wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions deploy workflow to set explicit Cache-Control headers when uploading the built Console to S3, aiming to prevent stale index.html from being cached (notably in Safari) while allowing long-term caching for static assets.
Changes:
- Upload non-
index.htmlartifacts with long-lived cache headers. - Upload
index.htmllast withCache-Control: no-storeto avoid stale SPA entrypoints.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6a63d23 to
e948e32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue: Slack thread
"Importing a module script failed" errors
We're having a lot of "Importing a module script failed" errors. The bug seems to happen a lot on Safari, which applies heuristic caching when Cache-Control is absent, but uses a different algorithm compared to Chrome-based browsers.
When neither
Cache-ControlnorExpiresis present, an HTTP cache may assign a heuristic freshness lifetime. This is standardized in RFC 9111 §4.2.2:The fix is for
index.htmlto not be cached, by adding aCache-Control: 'no-cache'header.Sources
Why you should use Cache-Control: no-store on index.html
HTTP Heuristic Caching
Screenshots / Recordings
Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-release