Reconsider the service worker
oskarrough opened this issue · 1 comments
oskarrough commented
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 commented
It's definitely caching too hard.