4 ms·
I'm more optimistic about using Service Workers in this way, but I agree this was definitely not their intended use case so there will be problems. There's ano
by nabakin 4y ago
I'm more optimistic about using Service Workers in this way, but I agree this was definitely not their intended use case so there will be problems.
There's another flaw I see with using Service Workers in this way. After a period of time where the Service Worker is inactive (a minute or so on Firefox), the browser will shutdown the Service Worker. When it shuts down, all variables in the Service Worker scope are freed and I assume the WebAssembly server instance as well. How would you maintain server state, in this scenario?
- madsbuch 4y agoCommit to a browser persistent storage or skip it off to a server.
- nabakin 4y agoThat's what I'm thinking too. There's no way to keep the state in Rust which means constantly updating a browser persistent storage through JS or keeping state client side in the tab's environment. A pretty janky workaround
- nymanjon 4y agoI pretty much build my personal offline-first web apps this way, but with JS. https://news.ycombinator.com/item?id=33319875 https://news.ycombinator.com/item?id=33319875