Book Image

PHP Ajax Cookbook

Book Image

PHP Ajax Cookbook

Overview of this book

Table of Contents (16 chapters)
PHP Ajax Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing comet PHP and Ajax


In traditional client-server communication over HTTP, for every response from a server, a request is made by the client. In other words, there is no response without a request.

Comet, Ajax Push, Reverse Ajax, Two-way-web, HTTP Streaming, or HTTP server push are the collective terms used to refer to the implementation of instantaneous data changes pushed from the server. Unlike in traditional communication, here, the request from the client is made once and all the data/responses are pushed from the server—without further request calls from the client.

Through comet, we can create Ajax chat and other live applications. Before the introduction of HTML5's WebSocket API, JavaScript developers had to go for hacks, such as using iframe, long polling Ajax, and so on

There are many comet technologies available, including a pure JavaScript approach over Apache web server. But, when looking at performance and approaches, the open source APE (Ajax Push Engine) technology...