pull down to refresh
105 sats \ 0 replies \ @rblb OP 19h \ parent \ on: Emulating SharedWorkers in browsers that do not support them devs
in my experience, current clients just spawn connections for each tab and they use some form of local storage for caching. Having a single shared worker that has one pool, one set of connections and persistent subscriptions would make them feel more like "normal" websites imo.
very simple approach: each worker gets an id when it spawns, they periodically send heartbeat messages to each other via a BroadcastChannel. The active worker with lowest id becomes the master.