mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
The dynamic /i18n/[locale] route handler answered with Next's default Cache-Control (private, max-age=0, must-revalidate) and no validator — its immutable-cache header was overridden, so a non-PWA browser would re-download the full catalog on every hard load. Static public/ files keep an ETag (repeat loads revalidate to a 304) and the service worker's cache-first rule covers the offline relaunch; the ?v= build key the layout appends busts both per deploy. scripts/generate-i18n-boot.mjs writes public/i18n/<locale>.js for all six locales as a prebuild/predev step (the sw-version.js pattern); output is gitignored. The route handler is removed. Measured on a production build, authenticated DE session: dashboard document 522 KB raw / 139 KB gz -> 170 KB raw / 24.6 KB gz; the DE catalog moves into a one-time 119 KB gz cached asset. H2