Performance of AJAX vs Websocket REST over HTTP 2.0?

前端 未结 2 1620
遥遥无期
遥遥无期 2020-12-05 21:19

What is the real-world performance difference between Websocket vs AJAX over HTTP 2.0?

In particular, a project I\'m working on requires bidirectional real-time upda

2条回答
  •  悲&欢浪女
    2020-12-05 21:51

    I would go with websockets definitely, much less hassle with that sweet syntax, but never forget to use socket.io, because as they are websockets don't do NAT traversal, and have a few more blockers, which might cripple your project.

    Also another fact, if you wish to do cordova ios and websockets go for the WKWebView 'cause you'll be badly suprised by the way they work in default browser of ios.

    And the last thing about websockets try not to use them for sending data from client to server only server -> client, because at the end of the day AJAX is a much more reliable solution than websockets.

提交回复
热议问题