popcodeorg / popcodeorg/popcode
Audit and improve service worker loading strategy
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 191
- Forks
- 143
- Ø Merge
- 4 T. 11 Std.
- Gemergte PRs (30 T.)
- 5
Beschreibung
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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der Prüfung der vorhandenen Service-Worker-Konfiguration und der Optionen von offline-plugin und vergleichen Sie sie anschließend mit den in der Ausgabe verlinkten Richtlinien zum Hochleistungsladen von Service-Workern. Untersuchen Sie das Caching versionierter Assets, das zweistündige Ablaufdatum im Browser und das Verhalten in der Entwicklung; abgeschlossen ist die Aufgabe, wenn Sie eine Strategie auswählen und anwenden, die den Offline-Zugriff und zuverlässige Aktualisierungen gewährleistet und gleichzeitig die Ladeleistung der Assets verbessert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- performance, web-dev
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100