Serve compressed JavaScript and CSS from data.firefox.com
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions, google-cloud, javascript
- Ambito
- devops, performance
Direzione di ricerca
Read .github/workflows/deploy.yml and docs/architecture/deploy.md to understand the upload and CDN path. First check the proposed gcloud storage cp option and validate a stage deployment with the provided curl -sI command. Done means text assets return content-encoding: gzip and the site still loads in Firefox, Chrome, and Safari, with CDN behavior and deep links checked.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Production serves JavaScript and CSS uncompressed. Every assets/ response from data.firefox.com comes back with no content-encoding, even though the browser offered gzip, br and zstd:
| File | On the wire today | Gzipped (vite preview) |
|---|---|---|
index-*.js |
214 KB | 71 KB |
DashboardContainer-*.js |
179 KB | 68 KB |
ChartContainer-*.js |
268 KB | 90 KB |
On a slow 4G connection, the main script alone takes 1.76 s to download in production, against 0.97 s from a local gzipped build. Every step of a first visit waits on downloads like this one. This is the largest single cost found while measuring #516, and it lives in the deploy, not the app.
The transposer's JSON under datasets/ is uncompressed too.
Proposed fix
In .github/workflows/deploy.yml, upload text assets gzip-encoded:
gcloud storage cp --gzip-local-extensions=js,css,svg,html,json ...
This stores each object gzip-compressed, with Content-Encoding: gzip. Cloud Storage decompresses on the fly for the rare client that doesn't accept gzip.
To check
- After a deploy to stage, check that
curl -sI -H 'Accept-Encoding: gzip' <stage>/assets/index-*.jsshowscontent-encoding: gzip, and that the site still loads in Firefox, Chrome and Safari. - Check that the CDN in front of the bucket (
FORCE_CACHE_ALL, seedocs/architecture/deploy.md) passes the encoding through and still serves deep links. - Ask the CDN/bucket owners in Data Engineering whether Cloud CDN's dynamic compression (brotli) can be turned on. That would also cover the transposer's JSON without any change to how it uploads.
- Separately, the CDN rewrites
cache-controltopublic,max-age=0on content-hashed assets, so they're revalidated on every visit. That's worth raising in the same conversation.
Found while measuring #516.
- Lingua principale
- JavaScript
- Stelle
- 21
- Fork
- 7
- Merge medio
- 3g 23h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mozilla/ensemble
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 5 giorni
-
Explore ways to improve first-load performanceForse già presa @stephaniehobson l’ha presa 4 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
mozilla/ensemble#516 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
mozilla/ensemble#496 · 2 commenti ·
I maintainer di solito rispondono entro 5 giorni
-
Post-deploy housekeeping: build script order, source maps, ogimage.xcf, old static/ treeForse già presa @stephaniehobson l’ha presa 14 giorni fa. Aperta
mozilla/ensemble#488 · 1 assegnatario ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di mozilla/ensemble
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Inter-Actief/amelink#140 ·
-
area:tooling priority:p3 scope:infrastructure size:s status:ready type:chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
pre-existing
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno