Reverse Ajax: Difference between revisions
FatalError (talk | contribs) m I think we can all agree that it's better off being merged into Comet, not Ajax |
I think we have two merge proposals |
||
Line 1: | Line 1: | ||
{{Mergeto|Comet (programming)|date=June 2008}} |
{{Mergeto|Comet (programming)|date=June 2008}} |
||
{{Mergeto|Ajax (programming)|date=June 2008}} |
|||
{{Orphan|date=June 2008}} |
{{Orphan|date=June 2008}} |
||
'''Reverse Ajax''' refers to an [[Ajax (programming)|Ajax]] [[design pattern]] that uses long-lived [[HTTP]] connections to enable [[Latency (engineering)|low-latency]] communication between a [[web server]] and a [[web browser|browser]]. Basically it is a way of sending data from client to server and a mechanism for pushing server data back to the browser.<ref>{{cite book |
'''Reverse Ajax''' refers to an [[Ajax (programming)|Ajax]] [[design pattern]] that uses long-lived [[HTTP]] connections to enable [[Latency (engineering)|low-latency]] communication between a [[web server]] and a [[web browser|browser]]. Basically it is a way of sending data from client to server and a mechanism for pushing server data back to the browser.<ref>{{cite book |
Revision as of 15:52, 16 June 2008
![]() | It has been suggested that this article be merged into Comet (programming). (Discuss) Proposed since June 2008. |
![]() | It has been suggested that this article be merged into Ajax (programming). (Discuss) Proposed since June 2008. |
Reverse Ajax refers to an Ajax design pattern that uses long-lived HTTP connections to enable low-latency communication between a web server and a browser. Basically it is a way of sending data from client to server and a mechanism for pushing server data back to the browser.[1][2]
This server–client communication takes one of two forms:
- Client polling, the client repetitively queries (polls) the server and waits for an answer.
- Server pushing, a connection between a server and client is kept open, the server sends data when available.
Reverse Ajax describes the implementation of any of these models, including a combination of both. The design pattern is also known as Ajax Push, Full Duplex Ajax and Streaming Ajax.
Examples
The following is a simple example. Imagine we have 2 clients and 1 server, client1 to sends the message "hello" to every other client.
With traditional Ajax (polling):
- client1 sends the message "hello"
- server receives the message "hello"
- client2 polls the server
- client2 receives the message "hello"
- client1 polls the server
- client1 receives the message "hello"
With reverse Ajax (pushing):
- client1 sends the message "hello"
- server receives the message "hello"
- server sends the message "hello" to all clients
Note that with reverse Ajax less traffic is generated and the message has been transferred with less delay (low-latency).
See also
References
- ^ Crane, Dave (2008). Comet and Reverse Ajax: The Next Generation Ajax 2.0. Apress. ISBN 1590599985.
{{cite book}}
: Unknown parameter|coauthors=
ignored (|author=
suggested) (help); Unknown parameter|month=
ignored (help) - ^ Martin, Katherine (2007-03-22). "Developing Applications using Reverse Ajax". java.net, O'Reilly and CollabNet.
{{cite web}}
: Check date values in:|date=
(help)