|
|
|
|
|
by mikeaag
3659 days ago
|
|
Hey subie, I'm one of the creators of Real Time Users. Only 1 AJAX call get sent to 'track' you on the site for each page load. The AJAX calls you're seeing are asking the server for the latest number of users on the site so that we can update the value displayed. This isnt the most efficient way of doing this, as if the site has a low number of users, the count will return the same number most of the time. A better way would be to use websockets, however i only have limited knowledge of using websockets so we decided it was best to just stick to the tech we knew (Especially as we built it in a weekend). If people start using this more, we might update it to use websockets though. Hope that answers your questions. Let me know if theres anything else you'd like to know. |
|
My implementation is in-memory, and the nice thing about it is that if fit example my Node.js app restarts, all active users will get disconnected, and they will emit a connection event, allowing me to get the count of online users again.
I can extract relevant code and share it if it'd help.