Which is faster - WebSockets or Ajax?

I am sure that WebSockets is much faster. Therefore, if I want to use ajax lots continuously, is it recommended to use WebSockets as an alternative?

+3
source share
5 answers

These are two different technological things. With an AJAX client, just send a request to the server and wait for a response. Websocket is an implementation of HTML5 for Comet technology, the idea is to transfer information from the server to the client.

+3
source

Ajax is slower because overhead. But Ajax is more compatible, Websocket is currently a bit experimental, and it is not supported by most browsers.

+1
source

, , .

0

, , -, . - - - websocket ( ) - .

0

WebSockets!. WebSockets Erlang - . , ,   - , .

And they are experimental, but work well in Chrome, Firefox, Android and iOS. The only problem was data analysis using BB, which was due to the library we used, so we rewrote the library data analysis algorithm and it worked. We tested only on these platforms.

You can check out Socket.IO, which improves the raw implementation of WebSockets. Follow this link for some quick demos: http://socket.io/#how-to-use

0
source

Source: https://habr.com/ru/post/1752097/


All Articles