matrix icon indicating copy to clipboard operation
matrix copied to clipboard

Make it a PWA so it can work offline.

Open normanr opened this issue 4 months ago • 5 comments

I use this as a screensaver, and when my internet is disconnected it doesn't work. It would be nice to implement https://web.dev/learn/pwa/caching/ and https://web.dev/learn/pwa/serving#cache_first so that it can work offline.

It's pretty easy and only requires the addition of a webmanifest and a service worker in order to work. I've done this before if you want some simple examples: manifest and worker: https://github.com/normanr/ir-ctl-web/commit/28f8e18da8e7f5ec372464ea2fe137a68051bfa0 + caching: https://github.com/normanr/ir-ctl-web/commit/617483dd8ee44c4c0ca3c2e9accb780de89b013c

normanr avatar Aug 31 '25 01:08 normanr

Oh neat! I'll chuck that in. Thanks for the insight and patience 🌟

Rezmason avatar Sep 10 '25 12:09 Rezmason

Life's been a whirlwind, gonna bang this out right now

Rezmason avatar Sep 23 '25 05:09 Rezmason

@normanr offhand, do you know if caching is possible without a service worker? I know keeping everything on the main thread is inadvisable, but my project fetches things very rarely, and I'd rather be certain that it doesn't leave some lingering background task on visitors' devices.

Rezmason avatar Sep 23 '25 17:09 Rezmason

I believe a service worker is required to handle the network request to serve the results from the cache. It should only be active when the website is in use.

normanr avatar Sep 24 '25 01:09 normanr

Well all right 😄 I'll resume tomorrow evening, as I am booked solid 👍

Rezmason avatar Sep 24 '25 03:09 Rezmason