Нужно переменную globalVersion указать как 1, а localVersion = 0. Тогда при первоначальной инициализации будет отрисовка данных подписчиков. Если открыть новую вкладку при уже изменённых данных они будут перерисованы.
The problem is most hosts do not allow them. If you try to implement one in some way a lot of times they will kick you off because they are resource intensive. getting a host that will support them is expensive.
This way is better than websockets. So if host accepts websockets, then sse should also be accepted because sse only update when new version, whereas websockets is always open and sending
Hey, nice explaination... I had a question. What if I want to send/broadcast events/messages to say 10s of millions of clients/subscribers. How can we scale server sent events to achieve that?
There are no groups or rooms, so create a list with ids of the users you want to receive a message. Loop through the list in the SSEand if there is a match, send the data