My main language is PHP, this a burst of ideas, Web applications, without regard to compatibility, you can use the socket to replace the work of Ajax?
Is it OK to do this (or should I do that)?
Will performance improve? Will consumption increase?
I hope you can help me to answer (I hope this is not a very stupid question ...), thank you.
Reply content:
My main language is PHP, this a burst of ideas, Web applications, without regard to compatibility, you can use the socket to replace the work of Ajax?
Is it OK to do this (or should I do that)?
Will performance improve? Will consumption increase?
I hope you can help me to answer (I hope this is not a very stupid question ...), thank you.
Yes, the page performance is definitely a boost, because the Socket for HTTP has its own bit, that can hold for a long time, and no head content, these benefits for performance is significantly improved. Consumption, the consumption of the server will certainly be a bit bigger, after all, n access, you have to hold n links, this fact is placed there.
without regard to compatibility.
- If you have a high demand for real-time, you can consider using WebSocket, because the delay is much lower, such as doing some message push functions, and frequent communication words to maintain a better connection.
- If you just do a query without timing, you should still use Ajax.
Personal opinion, for reference only ~
Right, now both requirements exist, in order to improve the real-time can only reduce the polling time, the server is too unbearable.
So think of the socket above, the problem is not tried before, and do not know how the actual consumption, no end