Live data from Hacker News

Show a real-time user count without any client-side Javascript

minipenguin.com

11–20 of 24 posts

Re: Show a real-time user count without any client-side Javascript

#11

It's worth noting that the author of this blog is a 17 year old self-taught hacker. Highly impressive.

Yep, I like this as well. I'm an 18 year old cofounder/designer hacker and sent him an email to hopefully get connected. I'm always on the lookout for young people like me that have started early. (not to bash on anyone that started late, but it's cool to meet people along my same path)

Re: Show a real-time user count without any client-side Javascript

#12
M-JPEG is not the same thing as x-mixed-replace.

M-JPEG is a concatenated stream of JPEG images, usually with some of the JPEG elements omitted.

x-mixed-replace is what he is using. It is from the early Netscape days and let you server side push new content. In this case JPEG images.

Either technique can be used to stream images depending on browser capabilities.

Re: Show a real-time user count without any client-side Javascript

#14
post #12

M-JPEG is not the same thing as x-mixed-replace . M-JPEG is a concatenated stream of JPEG images, usually with some of the JPEG elements omitted. x-mixed-replace is what he is using. It is from the early Netscape days and let you server side push new content. In this case JPEG images. Either technique can be used to stream images depending on browser capabilities.

You're right. I just updated my entry to be more accurate in this sense.

Re: Show a real-time user count without any client-side Javascript

#15
post #12

M-JPEG is not the same thing as x-mixed-replace . M-JPEG is a concatenated stream of JPEG images, usually with some of the JPEG elements omitted. x-mixed-replace is what he is using. It is from the early Netscape days and let you server side push new content. In this case JPEG images. Either technique can be used to stream images depending on browser capabilities.

Actually you could use x-mixed-replace with other content-types like text/html. I don't know if it still works with modern browser but you should be able to put the counter in an iframe.

Re: Show a real-time user count without any client-side Javascript

#16

It's worth noting that the author of this blog is a 17 year old self-taught hacker. Highly impressive.

Yep, I like this as well. I'm an 18 year old cofounder/designer hacker and sent him an email to hopefully get connected. I'm always on the lookout for young people like me that have started early. (not to bash on anyone that started late, but it's cool to meet people along my same path)

Wish there had been more hackers around when I started at the age of 15. But then that was 1972 :-)

Re: Show a real-time user count without any client-side Javascript

#17
post #13

Ingenious. I imagine this would also be easy to implement in e.g. PHP. Or am I wrong? (not at my PC to check)

Sounds like there would be some issues with PHP script timeouts, since you'd have to tie up a whole web server thread with a connection that doesn't close.

Re: Show a real-time user count without any client-side Javascript

#18
very cool, and apparently quite simple. but when I look at the network log with the developper tools apparently chrome doesnt register loading a new image. is it possible that it will never show up there because it doesnt finish loading?

looking at the response headers of online.png shows:

     Cache-Control:no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0, false
     Connection:Close
     Date:Sun, 29 Jul 2012 11:04:04 GMT
     Expires:-1
     Last-Modified:Sun, 29 Jul 2012 11:04:04 GMT
     Pragma:no-cache
     Transfer-Encoding:chunked
so that can't be the jpeg mentioned
Post reply on HN