问题
Can anybody describe me the difference between reverse ajax and normal ajax . If possible explain what reverse ajax can do in web world , some real world examples too.
I never used this reverse ajax ,is that apt for normal web application?
回答1:
Normal ajax, you need to poll your server from your client periodically.
For reverse ajax, the server pushes update to your client when it has.
回答2:
Reverse Ajax: is essentially a concept: being able to send data from the server to the client. In a standard HTTP Ajax request, data is sent from client to the server.
Other simmilar terms are HTTP Polling, Long Polling, Comet, Server Push, Web Sockets in HTML5.
Comet is a web application model where a request is sent to the server and kept alive for a long time, until a time-out or a server event occurs. When the request is completed, another long-lived Ajax request is sent to wait for other server events. With Comet, web servers can send the data to the client without having to explicitly request it.
Here is an sample demo which I shared on github to show reverse ajax using servlet3.0 async feature https://github.com/uravik21/ReverseAjax-JspTagJspFragment
来源:https://stackoverflow.com/questions/9888418/difference-between-reverse-ajax-and-normal-ajax