6 ms·
Realtime Hacker News
- younata 16y agoIt's neat. But, for me, I prefer the regular, static, interface. The main page doesn't change enough to warrant using a a realtime interface.
- michaelhart 16y agoTrue, but for many people, like me, we're refreshing HN every few minutes anyway. Why not have the 2 most common pages (for me anyway) on 1 screen powered by ajax to load all of the data. I also cache all of the data on my server in a database, so it actually lessens the load on HN's servers. It turns hundreds of requests into a handful. I also have everything tuned for automatic performance scaling, so if HN responds too slowly, I'll request pages less frequently, or if my server starts getting loaded, I'll increase the interval of the ajax requests.
- CWIZO 16y agoAdd some spacing between items please. It's almost unreadable right now. Also the new/home text backgrounds interfere with the content. It would also be nice if I could login somehow and vote/comment on your page (real time comments maybe?). Great stuff tho! edit: just noticed that your version of the home page is completely different than the one here. Or am I missing something? edit2: scratch that, you display items in reverse order. Why is that?
- michaelhart 16y agoI wasn't aware, I fixed it :) As for the text, I'll lower the opacity to like 5% and see if that helps. Also adding spacing now. Thanks :D edit: spacing added; looks much better :) thanks again!
- erikano 16y agoInteresting. However, I get three duplicate entries. I'm using Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.4) Gecko/20100630 Firefox/3.6.4. [1]: https://st.atic.co/screenshot/realtime_hn_duplicates.png https://st.atic.co/screenshot/realtime_hn_duplicates.png
- michaelhart 16y agoI just modified the way the queries run; duplicates should be MUCH less common now.
- acconrad 16y agoIt would be real time if it didn't take an eternity to load. Neat concept though.
- michaelhart 16y agoDespite how efficient I made it, apache seems to have trouble keeping up. I'm tuning it trying to find a good balance.
- rgrieselhuber 16y agonginx?
- michaelhart 16y agoApache handles dynamic content better than nginx in most cases. Nginx is usually only desirable when memory is a constraint or for serving static content. I've optimized apache, and it's handling the traffic quite well now with average response times of 20-60ms (including generation and network latency), which is quite nice :)
- tptacek 16y agoI don't get it. Exactly why do I want the Hacker News front page to change out from under me while I read it?
- michaelhart 16y agoWell, it doesn't update THAT often, so it's not like it's constantly moving :) But that's also the reason why I didn't make realtime conversations... It's too hard to make it not annoying.
- daleharvey 16y agoThis is a nice idea I agree with the added spacing, also it doesnt matter if backgrounds are very opaque they are still distracting while they are visible. I would prefer to not have both screens viewable, just the same interface by clicking new / home on the top navigation. Thanks for doing this, looks like a fun experiment
- michaelhart 16y agoI just significantly improved caching to further reduce the necessity of hitting Hacker News. This should fix a lot of performance issues as well as blank pages. As for duplicates, I have tried to make that much less likely by putting the status closer to the update query. There are lot of hits per second, which causes that. (Queries take around 0.005s to perform; if 2 hits within that time period, then it could update the cache twice (or more)).
- wglb 16y agoReally, let's not do this.
- vic_nyc 16y agoWould be interesting if you could post the tech details about how you implemented it. I've been experimenting with websockets in Clojure, Ruby and Node and so far I have found that in practice it's harder to do than the simple tutorials would have make it seem. For example, I realized that due to the same origin policy, the client and server involved have to run on the same ports (not just same machine) which makes it seem that the same server has to serve them.
- michaelhart 16y agoIt's all written in php/codeigniter and mysql. It's very fast thanks to codeigniter being very lightweight and due to caching provided by mysql. I'll try to write a blog post tomorrow... www.michaelhart.me
- lgeek 16y ago> For example, I realized that due to the same origin policy, the client and server involved have to run on the same ports (not just same machine) which makes it seem that the same server has to serve them. Mongrel2 (http://mongrel2.org/home http://mongrel2.org/home) might help with that.
- adaml_623 16y agoI'm assuming this shows me items that haven't made the front page? I think that's very useful.
- michaelhart 16y agoThe left side is newest, the right side is news (homepage).
- marcamillion 16y agoThis is actually pretty neat. It helps me discover new stories better than a static HN front-page. I really like the layout and everything.
- jeffmiller 16y agoI shudder for the personal productivity of someone who needs a realtime version Hacker News.
- michaelhart 16y agoIt's getting quite a bit of users, and the average session length is 14 minutes. Quite interesting :) I love it. It's sort of like Gmail, minus the notifications through my phone (which is a good thing, because it would be way too spammy). I can rest assured that when I visit that tab, I see the latest stuff. No refreshing or checking both pages. I have them both, always up to date, and at a glance.
- nolite 16y agonice! maybe the new things could show up at the top though? so we wouldn't have to keep scrolling