Skip to content

fix(deploy): serve i18n JSON no-cache so translations refresh after deploy - #34

Merged
jhosepmyr merged 1 commit into
developfrom
bugfix/i18n-immutable-cache
Jul 10, 2026
Merged

fix(deploy): serve i18n JSON no-cache so translations refresh after deploy#34
jhosepmyr merged 1 commit into
developfrom
bugfix/i18n-immutable-cache

Conversation

@jhosepmyr

Copy link
Copy Markdown
Contributor

Description

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 (raw keys / stale translations across devices). 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. Complements the per-load ?v= cache-bust already on develop.

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)
  • 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. Deploy from develop (staging) or inspect the workflow.
  2. In DevTools → Network, i18n/en.json responds with Cache-Control: no-cache, must-revalidate (not immutable); after a deploy that changes a translation, a reload shows the new value.

Notes

  • bugfixdevelop. The same change ships to production via the hotfix/i18n-immutable-cachemain 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 33551fd into develop 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