popcodeorg / popcodeorg/popcode

Audit and improve service worker loading strategy

Open
#1,294 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted performance
Dominant language
JavaScript
Stars
191
Forks
143
Avg merge
4d 11h
Merged PRs (30d)
5

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing service worker configuration and the offline-plugin options, then compare them with the service-worker high-performance loading guidance linked in the issue. Investigate versioned asset caching, the two-hour browser expiry, and development behavior; done means selecting and applying a strategy that preserves offline access and reliable updates while improving asset loading performance.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance, web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.