HTML and CSS Reference
As more of us (we developers are the pioneers) started to build web applications, the demands on the web browser
increased. Performance became a problem; not just the web browser application but also the machines that the
browsers were running on. Those really pushing the boundaries of web technologies and web applications also hit a
big stumbling block: HTTP. 4
HTTP was designed to be a protocol in which a client makes a request for data and receives a response. However,
some web applications began to require that information be sent from the server to the client. So we had to start hacking!
Hacking can result in nonstandardized and complex solutions. Throw the state of feature support across web browsers
into the mix, and you can imagine the complexity of some of the solutions to this problem (we'll cover some of them later).
It has taken solutions like Twitter and Facebook, with their enormous popularity, to demonstrate the benefit and
need for experiences powered by realtime web technologies. This has lead to a vast improvement and availability of
realtime web technologies, driven by demand.
But First: What Does “Realtime” Actually Mean?
The term realtime refers to the timely nature between an event's occurrence and our being made aware of it. The
measurement in time between an event occurring and the delivery of that event really depends on the event. If the
event is applying your foot to a car brake, then the time between your foot going down and the brakes being applied
has to be absolutely minimal. However, if the event is sending a chat message in a soccer forum and it is displayed to
other users, a few seconds is unlikely to make a big difference. Ultimately, the event needs to be delivered in a short
enough amount of time for that event to still be relevant; to still have meaning within the context it applies. Imagine
getting slapped in the face: there is no delay between the impact of the slap and the registration of pain. This is
realtime. If there were a delay, it would be awfully confusing.
However, the ability to add any kind of realtime experience wasn't initially all that easy. But developers are not
easily defeated and have come up with clever workarounds and “hacks” to solve the communication breakdown
between the server and the client.
■ some of the earliest methods of creating two-way communication with the server have been omitted here
because they're not often used.
send HTTP requests asynchronously , or without requiring a reload of the current page. This is called AJAX , or
This method is great for adding user triggered functionality to a web app, so still typically relied on an event in the
browser, such as a click, and therefore didn't really solve any problems in the quest to keep content up-to-the-minute.
After AJAX took hold, it was a short jump to try and take the browser event out of the equation and to automate
setInterval() function to check for updates every n seconds.