Serve compressed JavaScript and CSS from data.firefox.com
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- github-actions, google-cloud, javascript
- Área
- devops, performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 21
- Forks
- 7
- Merge medio
- 3 d 23 h
- PR fusionados (30 d)
- 23
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mozilla/ensemble
-
Do not show all data by defaultAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 5 días
-
Explore ways to improve first-load performancePosiblemente ocupada @stephaniehobson la tomó hace 4 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
mozilla/ensemble#516 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
mozilla/ensemble#496 · 2 comentarios ·
Los mantenedores suelen responder en 5 días
-
Post-deploy housekeeping: build script order, source maps, ogimage.xcf, old static/ treePosiblemente ocupada @stephaniehobson la tomó hace 14 días. Abierto
mozilla/ensemble#488 · 1 asignado ·
Los mantenedores suelen responder en 5 días
Todos los issues de mozilla/ensemble
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Inter-Actief/amelink#140 ·
-
area:tooling priority:p3 scope:infrastructure size:s status:ready type:chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
pre-existing
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día