Repository navigation
perf(frontend): cache hashed assets and fonts long, revalidate index.html on Firebase - #609
Merged
Merged
Conversation
…html on Firebase Vite emits hashed files to /assets (the old rule matched the CRA-era static/ path), so fonts had no long cache header. index.html now revalidates, so a new deploy is picked up immediately and never references already purged chunks from a stale copy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Visit the preview URL for this PR (updated for commit 0c1001c): https://tormap-36f44--pr609-perf-frontend-fireba-h2us8ioj.web.app (expires Wed, 11 Nov 2026 17:28:51 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 0c1f71965de18e60b0e686b0d0356977fec090dc |
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.
What
Cache headers in
frontend/firebase.jsonfor the Vite build output:assets/**and*.woff2getmax-age=31536000, immutable. The old rule targeted the CRA-erastatic/**path, which does not exist anymore, so the fonts had no long cache header./and/index.htmlgetno-cache(revalidate with ETag, a cheap 304). Without it Firebase's default one hour cache can serve an oldindex.htmlthat references hashed chunks of a previous deploy.Firebase Hosting already compresses text responses (gzip/Brotli), so no compression change is needed. Permalinks use the URL hash, so the app is only entered via
/or/index.html.Verification
Only the JSON syntax is checked locally, the headers cannot be exercised without a Firebase deploy. After deploying, check:
Dependencies
None.
Deployment notes
None beyond the usual Firebase deploy.
🤖 Generated with Claude Code