slaytheweb icon indicating copy to clipboard operation
slaytheweb copied to clipboard

Reconsider the service worker

Open oskarrough opened this issue 2 years ago • 1 comments

The game installs a service worker which caches most assets for offline use. So far so good. But it doesn't detect updates, meaning you won't see the latest version on slaytheweb.cards unless you hard refresh.

Ideas

  • change to a minimal sw without extra caching, just to get PWA features
  • add a button to update the app, when there are updates (hard?)\
  • inspiration from the elk.zone pwa https://github.com/elk-zone/elk/blob/main/modules/pwa/runtime/pwa-plugin.client.ts
  • https://web.dev/learn/pwa/update/
  • https://vite-pwa-org.netlify.app/guide/prompt-for-update.html
  • https://vite-pwa-org.netlify.app/frameworks/preact.html

oskarrough avatar Sep 30 '23 08:09 oskarrough

It's definitely caching too hard.

oskarrough avatar Jan 19 '24 12:01 oskarrough