Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm interested to know the implementation of the 'new message' in gmail for example. I know that ajax is used, but what else it is used on the server and client side. Can you explain me the scenario?

Gmail is just a sample to sustain my question. I'm interested about the cheapest solution which allow to display new content in asynchronous manner without a user triggered event.

If you know a resource which explains the optimal way of implementing such app I will appreciated.


share|improve this question
up vote 2 down vote accepted

There is a server push technology going on there or maybe websocket. Allowing the server to notify the client when the server is being updated instead of ajax sending request every few seconds to check for changes.

Try searching for comet or Ajax Push. And also websocket.

share|improve this answer

Technique is called long polling, which basically means maintaining the request connection open. In particular case of AJAX name Comet was coined for it's various implementations.

With introduction of WebSockets this can be replaced by normal, persistent two-way communication.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.