javascript - AJAX or Socket.IO make more sense in my situation? -


I am working on something using AJAX, which sometimes needs seconds per second . Each post returns the JSN object (generated by PHP file, generated by ~ 11,000 bytes), and the average latency is between 30 MMS and 250 MMS, if I'm on WiFi or wired, but every broadly 1 / In the 15 calls it is about 4000 meters of spikes, I'm trying to find a way around it, because I see two options now:

  1. throw timeouts on AJAX calls, and It is asaf Make a call to L post still continue, it's a journey back as usual) or ...

  2. Cut everything down, node Learn JS to repair this problem so that I can possibly use the website.

The solution as far as I can see, is based on why the original call is failing if it is something wrong with the AJAX call, then one There is a possibility to go through the new GET, and resolve this issue. But if this is something with the server then logically GET time comes along with time, it is an issue with the server, and I'm dead in water.

I have no experience so far because I was expecting some feedback on the best action to take the next reaction. Thank you for the input.

If this helps, then I can greatly reduce the payload returning in 1/15 size with some flatter coding. Will it have the effect?

WebSocket is a great option! Actually work is very easy and it has a shallow learning curve.

  • Because the connection remains open, your request loses DNS lookup and routing for less latency. This means that there is very little overhead for each POST request you make.
  • If you ever want to push leave your data, then webSocket is the real way to do this. Ajax voting is going out of style.

He said, you will have to close the end of your back logic on javascript. You need to change your deployment strategy to a server that supports node applications. You have to deal with learning a new environment - something high can be.

Before finding the node, consider the flaws above. I think this is a great technique, but I also look at the following methods, especially if you are pressed for time.

  • 1/15 size reduction is totally worth it. Actually, it is worth it in both cases.
  • Can you batch with your post requests from the client side? If the latter requests rely on the results of the previous posting request, then you can not do this. In this case, I strongly suggest to use WebSocket.

Everything, if you are not pressed for time, nodes and sockets and rotations have been given, then they are becoming very popular web technologies and are worth learning.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -