-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementImprovement to existing featureImprovement to existing feature
Description
Problem
The Angular build currently produces unhashed filenames (main.js, polyfills.js) instead of content-hashed ones (main.abc123.js). Combined with Firebase Hosting's max-age=3600 cache header on JS files, this means:
- Users can be stuck on stale versions for up to 1 hour after a deploy
- The Angular service worker (
ngsw) has difficulty detecting new versions since filenames don't change - The "new version available" banner rarely triggers on mobile devices
Proposed Solution
Enable outputHashing: "all" in the Angular build configuration for test and production targets. This produces filenames like main.d4d9f2f.js which:
- Are safe to cache indefinitely (content changes = new filename)
- Allow
index.html(which references the hashed filenames) to be the only file that needs revalidation - Work correctly with
ngsw-config.jsonpatterns (already uses/main*.js,/polyfills*.js,/chunk-*.js)
Files to Change
apps/frontend/app/project.json— addoutputHashing: "all"to test/production build configurations- Optionally:
firebase.json— set longer cache TTL for hashed assets, shorter forindex.html
Context
Discovered during PR #378 (notifications + FCM push). Deploying new versions repeatedly showed that phones and browsers weren't picking up changes due to CDN-cached unhashed JS files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementImprovement to existing featureImprovement to existing feature