Users of our app often have many browser tabs open at once - routinely 10-20 on average. Obviously, this will run afoul of the max 5 or max 10 WebSocket
connections per user/app limit (I can never remember which is the accurate number, since the documentation lists both in different areas) for listening for Notifications.
I have been looking at using Web Workers to centralize a single WebSocket
for our entire app, no matter then number of open tabs. I am running into issues such as Shared Workers do support XMLHttpRequest
, but are not supported by all browsers and the GPC JS SDK doesn't really work in them due to root
assignment logic of this
vs. window
(would be great if this were addressed!). And Service Workers are not really geared towards that type of usage (although it would be AWESOME if GPC supported Push API).
Is there a recommended method for ensuring a single WebSocket
connection per user/browser?