That's an interesting approach, but it's still pooling, although I wouldn't know better.<p>Does anyone know what the alternatives are? Can you avoid pooling and still speak HTTP?
As far as a REST API supporting etags and if-none-match headers, it's pretty unexpected that if I supply an if-none-match to the request, the server may keep the connection open for an arbitrary amount of time. I'd expect that behavior to be a side-channel of the normal 304 response. For example, it should only keep the connection open if I supply ?timeout=60 resource option or X-Modification-Timeout: 60 header.
Your code samples are incredibly hard to read, you should use a different library to generate those. I don't know if it's just a Chrome thing, but they look like this to me:<p><a href="http://imageshar.es/52cf03f8f629007c1400043e" rel="nofollow">http://imageshar.es/52cf03f8f629007c1400043e</a>