Earlier quoted context omitted.
So every time a new comment is posted, is the CloudFlare cache invalidated and replaced with a new version of the comments page?
Actually for now, HN is not caching their HTML with us. we put a "CF-Cache-Status" header for when we are caching things
Ask HN: Why and how is Hacker News so fast?
31–40 of 110 posts
Re: Ask HN: Why and how is Hacker News so fast?
#32In addition to being so small (text-based, minimal JS), HN is cached by CloudFlare, which grabs copies of dynamic pages and pushes those copies out to their CDN edge servers around the globe so they're closer to end users. When your browser asks for the IP to news.ycombinator.com, you get the address of a cloudflare CDN server. Which web server the DNS server will send you is based on a GeoIP lookup of your own IP ad…
So every time a new comment is posted, is the CloudFlare cache invalidated and replaced with a new version of the comments page?
Re: Ask HN: Why and how is Hacker News so fast?
#33Heck, I get the feeling that they impact loading time more than my own CSS, images and Javascript. I already heavily minify and concatenate everything, as well as use SPDY for improved concurrent requests, but it seems Google and Twitter add 1-2 seconds.
Re: Ask HN: Why and how is Hacker News so fast?
#34For your need to simulate a 256kbps connection, two things have worked for me. Both require a good few mbps connection to begin with though: 1. Use Chrome's device emulator mode. You can ignore all other settings like screen size, user agent, etc. and just use the speed restriction. 2. Use a specialized WiFi router. I use the ones from TP-Link in which I can restrict speed for a particular device IP. DD WRT based rou…
Re: Ask HN: Why and how is Hacker News so fast?
#35In addition to being so small (text-based, minimal JS), HN is cached by CloudFlare, which grabs copies of dynamic pages and pushes those copies out to their CDN edge servers around the globe so they're closer to end users. When your browser asks for the IP to news.ycombinator.com, you get the address of a cloudflare CDN server. Which web server the DNS server will send you is based on a GeoIP lookup of your own IP ad…
Pretty close! We don't actually use GeoIP at the DNS level, we use the routing table of the internet to direct people to the closest location we have to them by announcing the same IP addresses in the routing table in many places (eg, anycast) You can find a blog post primer and general more explanation here: https://blog.cloudflare.com/cloudflares-architecture-elimina... the upshot of this is that TCP and SSL connec…
Re: Ask HN: Why and how is Hacker News so fast?
#36Server-side is a different beast than the whole server->client part. HN does not load particularly fast for me, 300-500ms is fairly slow.
Re: Ask HN: Why and how is Hacker News so fast?
#37Javascript is really the black hole, though. When people defer their client-side libraries to whatever CDN, and then let that library manage whatever it pleases for dependencies, forget it. That's like saying, I don't even care if people's computers catch fire and explode, when they try to watch this awesome star field simulation.
Oh yeah, and all the ads and spyware analytics too, ya know...
Re: Ask HN: Why and how is Hacker News so fast?
#38Server-side is a different beast than the whole server->client part. HN does not load particularly fast for me, 300-500ms is fairly slow.
slow Compared to what? Show me a social network/forum that you visit everyday and loads everything under 300ms.
Re: Ask HN: Why and how is Hacker News so fast?
#39Not pulling in a ton of external javascript, images, and ads is probably the biggest, but one thing that helps is that most comment threads have a relatively low number of comments. This page currently only pulls down down 12KB (compressed to 3.75KB). A thread like https://news.ycombinator.com/item?id=9976298 with ~600 comments pulls down 785KB (compressed to 143KB) In general, looking at the network tab in the devel…
Can someone buy the .text TLD already and make a whole part of the internet where this approach is standard?