Skip to content

hotfix(deploy): serve i18n JSON no-cache so translations refresh after deploy - #33

Merged
jhosepmyr merged 1 commit into
mainfrom
hotfix/i18n-immutable-cache
Jul 10, 2026
Merged

hotfix(deploy): serve i18n JSON no-cache so translations refresh after deploy#33
jhosepmyr merged 1 commit into
mainfrom
hotfix/i18n-immutable-cache

Conversation

@jhosepmyr

Copy link
Copy Markdown
Contributor

Description

Production hotfix for stale translations across devices: the deploy synced every non-index.html asset to S3 with Cache-Control: public, max-age=31536000, immutable, including the non-fingerprinted i18n/{lang}.json files. immutable tells browsers to cache them for a year without revalidating, so once a device cached en.json/es.json it 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's immutable copy never asks the CDN again.

Exclude i18n/* from the immutable sync and upload it (like index.html) with no-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 an immutable copy on their next load after this deploys.

Feature module / area: build / ci (deploy workflow)

Related issue / US:


Type of Change

  • fix — bug fix
  • build / ci — build, dependencies, or CI/CD

Checklist

  • The PR targets develop (not main) — N/A: this is a hotfix, intentionally targeting main (a matching bugfix/* PR carries it to develop)
  • Branch name follows feature/*, bugfix/*, or hotfix/*
  • Commits follow Conventional Commits
  • No secrets, credentials, or .env content committed
  • Deploy workflow YAML validated (parses cleanly)

How to Test

  1. Merge + deploy to production.
  2. On a device that currently shows stale/raw integration or billing labels, reload — the new main.js (index.html is no-cache) loads the app, which requests /i18n/{lang}.json?v=…; the browser bypasses its immutable copy and fetches the now-no-cache file → fresh translations.
  3. Verify in DevTools → Network that i18n/en.json responds with Cache-Control: no-cache, must-revalidate (not immutable).

Notes

  • Hotfix → main. A bugfix/i18n-immutable-cache PR applies the same change to develop.
  • No app code change; the ?v= client cache-bust is already on main (shipped via the release PR).

…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.
@jhosepmyr
jhosepmyr merged commit 968a493 into main Jul 10, 2026
3 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