popcodeorg / popcodeorg/popcode

Audit and improve service worker loading strategy

Aperta
#1,294 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

help wanted performance
Lingua principale
JavaScript
Stelle
191
Fork
143
Merge medio
4g 11h
PR unite (30g)
5

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando la configurazione esistente del service worker e le opzioni di offline-plugin, quindi confrontale con le indicazioni sul caricamento ad alte prestazioni del service worker collegate nell’issue. Analizza il caching degli asset versionati, la scadenza di due ore del browser e il comportamento in sviluppo; il lavoro è completato quando viene selezionata e applicata una strategia che preservi l’accesso offline e aggiornamenti affidabili, migliorando al contempo le prestazioni di caricamento degli asset.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
performance, web-dev
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.