Skip to main content
added 372 characters in body
Source Link
Arseni Mourzenko
  • 139.2k
  • 32
  • 359
  • 544

You're looking for (1) Server-sent events, (2) WebSocket and (3) long polling. All three are actual ways to solve the very same issue of receiving information on client side without doing the same request again and again (called polling).

In your case, start with Server-sent events (SSE). It doesn't look like you'll need the additional features of WebSocket, and SSE are likely to have a wider support compared to long polling in terms of proxy servers and other infrastructure.


This being said, your primary concern is indicative of premature optimization. You're expected to know exactly how many requests your server will handle, not guess things (because no matter how experienced you are, you'll get it wrong anyway). And you do know this number by running load tests, which would show the threshold above which your servers start misbehaving.

You're looking for (1) Server-sent events, (2) WebSocket and (3) long polling. All three are actual ways to solve the very same issue of receiving information on client side without doing the same request again and again (called polling).

In your case, start with Server-sent events (SSE). It doesn't look like you'll need the additional features of WebSocket, and SSE are likely to have a wider support compared to long polling in terms of proxy servers and other infrastructure.

You're looking for (1) Server-sent events, (2) WebSocket and (3) long polling. All three are actual ways to solve the very same issue of receiving information on client side without doing the same request again and again (called polling).

In your case, start with Server-sent events (SSE). It doesn't look like you'll need the additional features of WebSocket, and SSE are likely to have a wider support compared to long polling in terms of proxy servers and other infrastructure.


This being said, your primary concern is indicative of premature optimization. You're expected to know exactly how many requests your server will handle, not guess things (because no matter how experienced you are, you'll get it wrong anyway). And you do know this number by running load tests, which would show the threshold above which your servers start misbehaving.

Source Link
Arseni Mourzenko
  • 139.2k
  • 32
  • 359
  • 544

You're looking for (1) Server-sent events, (2) WebSocket and (3) long polling. All three are actual ways to solve the very same issue of receiving information on client side without doing the same request again and again (called polling).

In your case, start with Server-sent events (SSE). It doesn't look like you'll need the additional features of WebSocket, and SSE are likely to have a wider support compared to long polling in terms of proxy servers and other infrastructure.