LukePrior / nbn-upgrade-map

Interactive map showing premises eligible for the NBN FTTP upgrade program.
https://lukeprior.github.io/nbn-upgrade-map/
MIT License
100 stars 11 forks source link

Create Service Worker #308

Open LukePrior opened 7 months ago

LukePrior commented 7 months ago

Will allow site to load quicker and work offline with stored data when installed as a PWA.

Caching Strategy:

https://stackoverflow.com/questions/46036897/best-practices-for-detecting-offline-state-in-a-service-worker https://developer.chrome.com/docs/workbox/caching-strategies-overview/

LukePrior commented 7 months ago

Got this for now: https://github.com/LukePrior/nbn-upgrade-map/blob/main/site/serviceworker.js

LukePrior commented 7 months ago

Ok hopefully that will work ok, still needs an update to periodically purge caches if nearing storage limits

lyricnz commented 7 months ago

This might help with https://github.com/LukePrior/nbn-upgrade-map/issues/309

LukePrior commented 7 months ago

https://github.com/LukePrior/nbn-upgrade-map/issues/309#issuecomment-1822011979