5 ms·
This is one of the oldest tricks in the book and was used heavily before WebSockets and similar became mainstream.
by connordoner 3y ago
This is one of the oldest tricks in the book and was used heavily before WebSockets and similar became mainstream.
- k__ 3y agoI fondly remember html-only iframe chats.
- jchw 3y agoIIRC CGI:IRC had an even more clever version of this: still no JavaScript needed, but Also no refresh needed, as the chat frame response would simply be held open and stream new messages. I never dug too deep into it, but it seemed to work surprisingly well.
- dento 3y agoThis is called Server Sent Events, SSE for short. https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...
- disntthinkthis 3y agoThat’s the modern variation. The original didn’t have any framing like they.
- gfv 3y agoSSE 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.
- loo 3y agoThe broader technique became known as Comet: https://en.wikipedia.org/wiki/Comet_(programming) 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({ ... })
- jchw 3y agoSSE 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.
- loo 3y agoLooks 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
- jchw 3y agoWoah! 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 :)
- loo 3y agoMe 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!
- moltar 3y agoHa remember that too! It’s basically just keeping the socket open and continuously streaming a response. As if it’s just a slow download. It’d also send heartbeat null values to keep the connection open. Of course in the CGI days that really didn’t scale well as it required a whole process to run for each user.
- dujgdtgdrvd 3y agoit scaled as well as you would expect coming from those days. the alternative was a whole computer plus modem per user.
- tudorw 3y agocontroversial opinion, frames were awesome...for some things
- Lapsa 3y agoI got PTSD... then again, a lot of things were wrong about that system. GET requests casually loading up whole database in memory while calling stored procedures that inexplicably modify like half of persisted version of it. and that's just to render some stupid list o_0
- tudorw 3y agoagreed, I help make Chemistry World with a chemist that had a cool 3d .mol viewer with frames back in the day when 3d was pretty fancy :)
- Kye 3y agoAnd webcams. I still see these occasionally and wonder if something is broken before realizing it's old-school.
- 4pkjai 3y agoMonit does to this produce a live feed. It’s kind of annoying sometimes, you lose highlighted text.