||This article's lead section may not adequately summarize key points of its contents. (September 2012)|
Push, or server push, describes a style of Internet-based communication where the request for a given transaction is initiated by the publisher or central server. It is contrasted with pull, where the request for the transmission of information is initiated by the receiver or client.
General use 
Push services are often based on information preferences expressed in advance. This is called a publish/subscribe model. A client "subscribes" to various information "channels" provided by a server; whenever new content is available on one of those channels, the server pushes that information out to the client.
Synchronous conferencing and instant messaging are typical examples of push services. Chat messages and sometimes files are pushed to the user as soon as they are received by the messaging service. Both decentralised peer-to-peer programs (such as WASTE) and centralised programs (such as IRC or XMPP) allow pushing files, which means the sender initiates the data transfer rather than the recipient.
Email may also be a push system: The SMTP protocol is a push protocol (see Push e-mail). However, the last step—from mail server to desktop computer—typically uses a pull protocol like POP3 or IMAP. Modern e-mail clients make this step seem instantaneous by repeatedly polling the mail server, frequently checking it for new mail. The IMAP protocol includes the IDLE command, which allows the server to tell the client when new messages arrive. The original BlackBerry was the first popular example of push-email in a wireless context.
Another example is the PointCast Network, which gained popularity in the 1990s. It delivered news and stock market data. Both Netscape and Microsoft integrated it into their software at the height of the browser wars, but it later faded away and was replaced in the 2000s with RSS (a pull system).
Other uses of push-enabled web applications include market data distribution (stock tickers), online chat/messaging systems (webchat), auctions, online betting and gaming, sport results, monitoring consoles, and sensor network monitoring.
HTTP server push 
Generally the web server does not terminate a connection after response data has been served to a client. The web server leaves the connection open so that if an event is received by the server, it can be sent immediately to one or multiple clients; otherwise, the data would have to be queued until the client's next request would have been received. Most web servers offer this functionality via CGI (e.g., Non-Parsed Headers scripts on Apache).
Another mechanism is related to a special MIME type called
multipart/x-mixed-replace, which was introduced by Netscape in 1995. Web browsers interpret this as a document changing whenever the server feels like pushing a new version to the client. It is still supported by Firefox, Opera, and Safari today, but it is ignored by Internet Explorer. It can be applied to HTML documents, and also for streaming images in webcam applications.
The WHATWG Web Applications 1.0 proposal includes a mechanism to push content to the client. On September 1, 2006, the Opera web browser implemented this new experimental system in a feature called "Server-Sent Events". It is now being standardized as part of HTML5. Another related part of HTML5 is the WebSocket API, which allows a web server and client to communicate over a full-duplex TCP connection.
Long polling 
Long polling is itself not a true push; long polling is a variation of the traditional polling technique, but it allows emulating a push mechanism under circumstances where a real push is not possible.
With long polling, the client requests information from the server in a way similar to a normal polling; however, if the server does not have any information available for the client, then instead of sending an empty response, the server holds the request and waits for information to become available (or for a suitable timeout event), after which a complete response is finally sent to the client.
For example, BOSH is a popular, long-lived HTTP technique used as a long-polling alternative to TCP when TCP is difficult or impossible to employ directly (e.g., in a web browser); it is also an underlying technology in the XMPP, which Apple uses for its iCloud push support.
Flash XMLSocket relays 
See also 
- Apple Push Notification Service
- Android Cloud to Device Messaging Service
- Client–server model
- File transfer
- Pull technology
- Push Access Protocol
- Push e-mail
- Reverse Ajax
- Streaming media
- SQL Server Notification Services
- CGI Programming on the World Wide Web O'Reilly book explaining how to use Netscape server-push
- Server-Push Documents (HTML & XHTML: The Definitive Guide) O'Reilly book explaining server-push
- "Web Applications 1.0 specification".
- "Event Streaming to Web Browsers". 2006-09-01. Retrieved 2007-03-23.
- "Opera takes the lead with AJAX support among browsers: More efficient streaming". 2006-09-01. Retrieved 2007-03-23.
- Server-Sent Events
- Pushlets introduction
- JavaWorld article about pushlets
- "XEP-0124: Bidirectional-streams Over Synchronous HTTP (BOSH)". Retrieved 2012-06-26.
- W3C Push Workshop. A 1997 workshop that discussed push technology and some early examples thereof
- HTTP Streaming with Ajax A description of HTTP Streaming from the Ajax Patterns website
- The WebSocket API candidate recommendation
- HTML5 Server-Sent Events draft specification
- HTTP Server Push at UDAParts A commercial grade Comet implementation with source code available
- Google Web Toolkit's Server Push FAQ Explains Server Push and how you can achieve this with GWT
- Ajax Push Engine An open source web server for pushing real-time data to Rich Internet Applications using Comet
- GWT Comet Adapter Open source adapter for implementing server push in Google Web Toolkit
- XEP-0124: Bidirectional-streams Over Synchronous HTTP (BOSH) A dual HTTP long-lived connection
- Part 2 HTML5 Server-push Technologies Introduction into HTML5 Server-push Technologies. Part 1 covers ServerSent Events, Part 2 covers WebSockets
- Data from a Flex Publisher Client to a Consumer Client Covers Apache NMS, ActiveMQ and WebORB