First, what is push technology
As people become more familiar with the web, people want Web applications to be able to receive messages in real-time, just like local apps, so there's so-called "push technology." What we call server Push, or "Server Push Technology", is a typical example of chatting, message alerting, and dating sites that are used more frequently and become a hot issue in real-time applications.
Second, traditional implementations (pull technology)
There is a very similar implementation mechanism, that is, the traditional Ajax, it is to go to the server at a certain time to pull the information, but this method will particularly consume resources. It needs to always ask the server whether it can request data, and the real-time is very poor, because we usually have a time to request data.
Third, another implementation (push technology)
Obviously the use of timed pull is possible, but it consumes the server resources, so we need another way of implementation, it is what we call the push technology, actually it just looks a bit like push technology, it is still a pull in essence, but this time the pull has become very long, The server side can constantly spit things out.
Here are three common implementation technologies:
(1) Ajax long polling. The so-called Ajax long polling, its nature is still a pull, it is also a good push implementation, it will be that Ajax short polling will reduce a lot of unnecessary requests, so it both in the cost and in real-time, it is better. The implementation mechanism is that the client initiates an AJAX request, and the server will shelve the request until the timeout is reached or the data is returned, while the client waits for the Ajax to return to process the data and then initiates the next Ajax request.
(2) Use frame long connection. For long connections under the frame, one of the biggest problems is that if the frame is loaded, then the browser seems to have been displaying "load in" and dealing with the problem is not as convenient as frame.
(3) The use of Flash or HTML5 websocket, but these two kinds of support is not particularly special, because always facing the user's browser does not support the situation, at this time we should fall back to more compatible and popular technology to achieve.
(4) The use of the classic framework, in fact, we need to encounter problems, many people have already met and solved, we need to know how they solve these problems, and then we can come up with a better solution.
Finally, attach an article from IBM, Portal: http://www.ibm.com/developerworks/cn/web/wa-lo-comet/
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.