Hacker News new | ask | show | jobs
by dento 1148 days ago
This is called Server Sent Events, SSE for short.

https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...

4 comments

SSE is cool, but as others have pointed out, this isn't that. I also wouldn't call this Comet: almost unilaterally, Comet referred to using it in concert with JS/Ajax and usually was just a fancy way of saying long-polling (though I admit it's a bit broader than that in truth). What CGI:IRC did was different: it streamed HTML directly. More to the point, it didn't use chunked encoding or any kind of framing in the body. It just kept the connection open and kept sending HTML in realtime. I don't think this ever had a term associated with it, or at least I was never aware of one.
Looks like 'Comet' got coined in 2006. The CGI:IRC approach.. I had a smile and an "aha" on seeing the term "forever frames" :-)

I think the wiki page is wrong that it involved chunked encoding

Woah! I completely and entirely forgot the term "forever frame" existed.

Another term you don't see too often these days is the "holy grail" layout. I definitely remember the days of messing with negative margins and clearfix to get my page layouts to look nice while still working in IE 6 :)

Me too :-D

I think you're right that Comet refers more to the JavaScript techniques that came from those "forever frames".. but to me it was all about the streaming HTTP hack at the heart of it.

I guess it's academic now :-)

Regarding holy grail layout and IE6.. so you're telling me you're a masochist!

SSE came along much later. At the time it was common-ish to just slowly send HTML tags. I think at some point there was a gorgeous hack where they dynamically rendered and sent GIF frames with the messages of the chatroom.
The broader technique became known as Comet: https://en.wikipedia.org/wiki/Comet_(programming)

CGI:IRC used an early frame approach, no JS required.

At some point JSONP became popular, even for 3rd party APIs.

  <script src="http://dont-xss-me/please?format=jsonp&callback=lol">
Server writes:

  lol({ ... })

  lol({ ... })
That’s the modern variation. The original didn’t have any framing like they.