News for hackers. Stuff that matters.
Re:Stupid solutions: Live server push without JS by arraypad on Tuesday September 29, 2020 @04:43AM (#24625369)
The core of this is of course the response header "Content-Type: multipart/x-mixed-replace" which in theory lets the server push updated chunks of any content type (although apparently only images in Chrome since 2013 [1]).

While it's a crude and handy way to update some content after the initial load without JS, it was also widely used with JS before Web Sockets - to push messages to clients with less latency than XHR polling.

[1] https://en.wikipedia.org/wiki/Multipart/x-mixed-replace#Mixe...

Re:Stupid solutions: Live server push without JS by bullen on Tuesday September 29, 2020 @07:39AM (#24626441)
The big problem with this spec (which is shared today by all the HTTP uploads in the world) is that you have to check for the delimiter every byte!

"Content-Type: chunked" is much better because it gives you the size of each chunk upfront! But that requires .js and also was buggy in IE until version 7.

I made a multiplayer online system that relies on chunked: https://github.com/tinspin/fuse

Re:Stupid solutions: Live server push without JS by pronoiac on Tuesday September 29, 2020 @05:56AM (#24625744)
omg! I thought it would slowly create and send along an mjpeg video file. Server push animation is a 90's thing. I wrote something up about it in 2009, and posted a still-working demo, because of a thread here. https://pronoiac.org/misc/2009/10/server-push-animation/
Re:Stupid solutions: Live server push without JS by jswrenn on Tuesday September 29, 2020 @03:11PM (#24631722)
> although apparently only images in Chrome since 2013

I wonder if this includes SVG images...

EDIT: It does!