There are interactive sites (for example this :)) which can notice events without refreshing anything. For example, when I get an answer, a red circle will appear up there. I understand that it can be done with sending ajax
requests, say one about every 5 second - but it then would kill servers. Then how should a server send to clients that something changed?
Asked
Active
Viewed 115 times
1

John Smith
- 6,129
- 12
- 68
- 123
-
1possible duplicate of [AJAX Polling Frequency - To long poll or not to long poll?](http://stackoverflow.com/questions/3842063/ajax-polling-frequency-to-long-poll-or-not-to-long-poll) – JJJ Jun 01 '12 at 07:41
2 Answers
1
You can open an XHR that stays alive until the server has a state change to send the response.
This is known as long polling.

alex
- 479,566
- 201
- 878
- 984
-
-
I mean, this is still a continuous sending/receiving, overloading the server – John Smith Jun 01 '12 at 10:19