HTML and CSS Reference
Web engineers initially dealt with the issue using a technique called polling. Polling
is a synchronous method (that is, no concurrency) that performs periodic requests,
regardless whether data exists for transmission. The client makes consecutive re-
quests after a specified time interval. Each time, the server responds with the avail-
able data or with a proper warning message.
Though polling "just works", it is easy to understand that this method is overkill for
most situations and extremely resource consuming for modern web apps.
Long polling is a similar technique where, as its name indicates, the client opens a
connection and the server keeps the connection active until some data is fetched or
a timeout occurs. The client can then start over and perform a sequential request.
Long polling is a performance improvement over polling, but the constant requests
might slow down the process.
Streaming seemed like the best option for real-time data transmission. When using
streaming, the client performs a request and the server keeps the connection open
indefinitely, fetching new data when ready. Although this is a big improvement,
streaming still includes HTTP headers, which increase file size and cause unneces-
Postback and AJAX
The web has been built around the HTTP request-response model. HTTP is a state-
less protocol, meaning that the communication between two parts consists of inde-
pendent pairs of requests and responses. In plain words, the client asks the server
for some information, the server responds with the proper HTML document and the
page is refreshed (that's actually called a postback). Nothing happens in between,
until a new action is performed (such as the click of a button or a selection from a
perience) flickering effect.