News for hackers. Stuff that matters.
Re:Ask HN: Why and how is Hacker News so fast? by Twirrim on Sunday August 02, 2015 @10:48AM (#9990893)
It's relatively straightforward. Take a look at what Pingdom tells you it does when the site loads:

http://tools.pingdom.com/fpt/#!/cnYAuq/https://news.ycombina...

5 requests, Total size 12.6kB, total time 661ms. 1 request for the content, 1 for css, and then 3 gifs, all from a single domain (so just one DNS request). If you look at the profile, 47% of the time was spent doing that one DNS lookup, so subsequent requests will be even quicker (plus caching will handle those gifs just fine)

That's almost no work for the end client to do. No javsacript for the client to download, parse and process, just straight content to render and done.

The reduced request count is especially important when it comes to the mobile experience, where bandwidth might be great, but latency is terrible. Every request you have to make to render a page significantly impacts the loading time (HTTP2 helps here). Along with trying to reduce the number of resources being loaded on the screen, it's especially important to reduce the number of domains you're getting them from so you keep the DNS queries down.

Re:Ask HN: Why and how is Hacker News so fast? by kluck on Monday August 03, 2015 @04:52AM (#9994518)
There was a thread about slow web: https://news.ycombinator.com/item?id=9791606

I prefer a static site without JavaScript any time of day! (over a JS bloated webs(h)ite)

Re:Ask HN: Why and how is Hacker News so fast? by d357r0y3r on Sunday August 02, 2015 @11:12AM (#9990984)
Might be able to get that down to 5 requests if they use .pngs instead of .gifs and throw them into a sprite sheet.
Re:Ask HN: Why and how is Hacker News so fast? by killercup on Sunday August 02, 2015 @04:57PM (#9992460)
Those gifs are less than 1kB each. Just include them in the CSS as base64. Or don't, doesn't matter for a site with such simple code anyway.
Re:Ask HN: Why and how is Hacker News so fast? by supermatt on Sunday August 02, 2015 @11:36AM (#9991060)
You can also have gif spritesheets.
Re:Ask HN: Why and how is Hacker News so fast? by dohertyjf on Sunday August 02, 2015 @01:25PM (#9991452)
Woah didn't know that. Thanks!
Re:Ask HN: Why and how is Hacker News so fast? by ised on Sunday August 02, 2015 @11:23AM (#9991023)
"... (so just one DNS request)."

Are you sure?

request #1

1 news.ycombinator.com: 207 bytes, 1+0+4+2 records, response, noerror query: 1 news.ycombinator.com authority: ycombinator.com 172800 NS ns-225.awsdns-28.com

request #2

1 news.ycombinator.com: 225 bytes, 1+1+4+0 records, response, authoritative, noerror query: 1 news.ycombinator.com answer: news.ycombinator.com 300 CNAME news.ycombinator.com.cdn.cloudflare.net authority: ycombinator.com 172800 NS ns-1411.awsdns-48.org

request #3

1 news.ycombinator.com.cdn.cloudflare.net: 367 bytes, 1+0+5+10 records, response, noerror query: 1 news.ycombinator.com.cdn.cloudflare.net authority: cloudflare.net 172800 NS ns1.cloudflare.net

request #4

1 news.ycombinator.com.cdn.cloudflare.net: 89 bytes, 1+2+0+0 records, response, authoritative, noerror query: 1 news.ycombinator.com.cdn.cloudflare.net answer: news.ycombinator.com.cdn.cloudflare.net 300 A 198.41.190.47

A HOSTS file entry for HN will avoid this routine.

Re:Ask HN: Why and how is Hacker News so fast? by Twirrim on Sunday August 02, 2015 @11:51AM (#9991101)
maybe I should rephrase that as one outbound DNS query? The answer should be cached locally, or at least at your next hop resolver, and the TTL of 300 seconds is long enough to make it effective