popcodeorg / popcodeorg/popcode

Audit and improve service worker loading strategy

Abierto
#1,294 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

help wanted performance
Lenguaje dominante
JavaScript
Estrellas
191
Forks
143
Merge medio
4 d 11 h
PR fusionados (30 d)
5

Descripción

Right now, our service worker configuration is great for its original intent, which is to make Popcode available offline if a network connection is unavailable. The network-first strategy also has the advantage of making it reasonably simple to ensure that the most recent version of Popcode is always going to load.

However, if I’m not mistaken, there is some overhead to loading assets from a service worker, so I want to make sure we’re also using them in the most performant possible way. In particular, there is absolutely no reason to go network-first for versioned assets that I can think of.

Overall though this isn’t as much of a concrete proposal as a call for more investigation, into what options the offline-plugin gives us and how we can get the best performance from service workers. A couple of specific things to keep an eye on:

  • I’m not really clear on how service workers interact with normal browser caching. We currently have something like a 2 hour expiry on assets in the browser. Obviously this means we’re expiring versioned assets too soon. But a good strategy at the service worker level might make this less of a concern
  • Anything we do should make the development experience no worse. Ideally we would also not need to have substantially different service worker settings in development, although this may be unrealistic

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza revisando la configuración existente del service worker y las opciones de offline-plugin, y luego compáralas con las directrices de carga de alto rendimiento del service worker enlazadas en el issue. Investiga la caché de assets versionados, la expiración de dos horas del navegador y el comportamiento en desarrollo; se considera terminado cuando se selecciona y aplica una estrategia que preserve el acceso offline y las actualizaciones fiables, al tiempo que mejora el rendimiento de carga de los assets.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
performance, web-dev
Tipo de issue
Refactorización
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.