3 ms·
How does this work with a service worker? I've only managed to do this via SharedWorker (which is not available on Chrome on Android).
by nikeee 2y ago
How does this work with a service worker? I've only managed to do this via SharedWorker (which is not available on Chrome on Android).
- raggi 2y agoYou can just open a stream in the service worker and push events via postMessage and friends. Another nice thing to do is to wire up a simple filesystem monitor for all your cached assets that pushes path & timestamp events to the service worker whenever they change, then the service worker can refresh affected clients too (with only a little work this is endgame livereload if you’re not constrained by your environment)