by dugmartin · 4y ago · 0 comments
One thing I noticed is you are using server sent events for subscriptions. SSE have a lot of nice properties but do have one nasty limitation (from https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...):
"Warning: When not used over HTTP/2, SSE suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6). The issue has been marked as "Won't fix" in Chrome and Firefox. This limit is per browser + domain, which means that you can open 6 SSE connections across all of the tabs to www.example1.com and another 6 SSE connections to www.example2.com (per Stackoverflow). When using HTTP/2, the maximum number of simultaneous HTTP streams is negotiated between the server and the client (defaults to 100)."
This can lead to some weird bug reports from users.
I’m not fully understanding the response - are you saying that the limit is not imposed if you use https? Or am I reading wrong?
The default limit of ~100 connections should be more than enough for most applications (additionally, the JS SDK client maintains a single SSE connection for a page no matter to how many things the user has subscribed, so that also helps).
Best solution today is to move to http2 on your server -- which has an SSL (TLS 1.2) requirement.
Looks like pocketbase implements this. If you use another server, like nginx, you have to enable this for each site.