X
X
XenK2015-11-18 07:38:57
PHP
XenK, 2015-11-18 07:38:57

AJAX voting?

It is necessary to make a small vote on the site, a survey. It is necessary that the results are updated online, but not necessarily in real time, it is possible with a delay of 3-5 seconds. What is better, and most importantly, more efficient to use for this, AJAX long-polling? Or is it web sockets?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-11-18
@alexey-m-ukolov

If users keep the page open for a long time and there are many mobile users, then WS is better - this is a more sparing way for the battery. But for sockets, you need to raise the infrastructure or connect SaaS.
Long-polling is definitely not needed here, since without realtime, just periodic ajax requests are enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question