hotfix(deploy): serve i18n JSON no-cache so translations refresh after deploy - #33
Merged
Merged
Conversation
…eploy
The S3 sync marked every non-index asset immutable (max-age=1y), including the
non-fingerprinted i18n/{lang}.json files — so browsers cached them for a year
and never picked up translations added in later deploys (raw keys / stale copy
across devices). Exclude i18n from the immutable sync and upload it (like
index.html) with no-cache,must-revalidate so the browser revalidates it.
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.
Description
Production hotfix for stale translations across devices: the deploy synced every non-
index.htmlasset to S3 withCache-Control: public, max-age=31536000, immutable, including the non-fingerprintedi18n/{lang}.jsonfiles.immutabletells browsers to cache them for a year without revalidating, so once a device cacheden.json/es.jsonit never picked up translations added in later deploys — hence integration/billing labels rendering in one browser but not another. The CloudFront/*invalidation refreshes the CDN, but a browser'simmutablecopy never asks the CDN again.Exclude
i18n/*from the immutable sync and upload it (likeindex.html) withno-cache, must-revalidate, so browsers revalidate the JSON (ETag → 304) and get the fresh file after each deploy. Pairs with the already-shipped per-load?v=cache-bust, which unsticks devices currently holding animmutablecopy on their next load after this deploys.Feature module / area: build / ci (deploy workflow)
Related issue / US: —
Type of Change
fix— bug fixbuild/ci— build, dependencies, or CI/CDChecklist
develop(notmain) — N/A: this is a hotfix, intentionally targetingmain(a matchingbugfix/*PR carries it todevelop)feature/*,bugfix/*, orhotfix/*.envcontent committedHow to Test
main.js(index.html isno-cache) loads the app, which requests/i18n/{lang}.json?v=…; the browser bypasses itsimmutablecopy and fetches the now-no-cachefile → fresh translations.i18n/en.jsonresponds withCache-Control: no-cache, must-revalidate(notimmutable).Notes
main. Abugfix/i18n-immutable-cachePR applies the same change todevelop.?v=client cache-bust is already onmain(shipped via the release PR).