I
I
Ilya Suhodolskiy2015-03-20 17:32:02
Node.js
Ilya Suhodolskiy, 2015-03-20 17:32:02

The data has been updated on the server. How to inform the client?

When loading a page, I request a list of users from the server (get ajax) and display it. Let's say a new user has been added (added by another client). How to inform all clients that they need to make a request again (update data)?
At the office The React site in the Tutorial requests data from the server every 2 seconds, but I don't think this is the best option.
setInterval(this.loadCommentsFromServer, 2000);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2015-03-20
@suhodolskiy

web socket

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question