Using Nginx as a HTTP publish-subscribe server

Most of us are using one social network or another, and in recent years it is very clear that the social Internet is all about real-time. Driving this forward is asynchronous JavaScript HTTP calls which come in two forms, the short poll and the long poll.

To explain this let's take the simple example of a real-time updating status page. There are two possible ways of updating this page, one is that the JavaScript periodically fires a request, say every second, and gets an update from the server. This has its pros and cons, as it is clearly not real-time in the true sense. The other approach is the event driven one, where the JavaScript opens a connection with the server and waits till the server responds ...

Get Nginx 1 Web Server Implementation Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.