TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The 5-Hour CDN

417 pointsby robfigalmost 4 years ago

19 comments

simonwalmost 4 years ago
This article touches on &quot;Request Coalescing&quot; which is a super important concept - I&#x27;ve also seen this called &quot;dog-pile prevention&quot; in the past.<p>Varnish has this built in - good to see it&#x27;s easy to configure with NGINX too.<p>One of my favourite caching proxy tricks is to run a cache with a very short timeout, but with dog-pile prevention baked in.<p>This can be amazing for protecting against sudden unexpected traffic spikes. Even a cache timeout of 5 seconds will provide robust protection against tens of thousands of hits per second, because request coalescing&#x2F;dog-pile prevention will ensure that your CDN host only sends a request to the origin a maximum of once ever five seconds.<p>I&#x27;ve used this on high traffic sites and seen it robustly absorb any amount of unauthenticated (hence no variety on a per-cookie basis) traffic.
评论 #28055318 未加载
评论 #28056298 未加载
评论 #28055898 未加载
评论 #28055341 未加载
评论 #28055548 未加载
评论 #28057547 未加载
评论 #28054375 未加载
评论 #28063976 未加载
jaboalmost 4 years ago
Love the level of detail that Fly&#x27;s articles usually go into.<p>We have a distributed CDN-like feature in the hosted version of our open source search engine [1] - we call it our &quot;Search Delivery Network&quot;. It works on the same principles, with the added nuance of also needing to replicate data over high-latency networks between data centers as far apart as Sao Paulo and Mumbai for eg. Brings with it another fun set of challenges to deal with! Hoping to write about it when bandwidth allows.<p>[1] <a href="https:&#x2F;&#x2F;cloud.typesense.org" rel="nofollow">https:&#x2F;&#x2F;cloud.typesense.org</a>
评论 #28056193 未加载
amirhirschalmost 4 years ago
This is cool and informative and Kurt&#x27;s writing is great:<p>The briny deeps are filled with undersea cables, crying out constantly to nearby ships: &quot;drive through me&quot;! Land isn&#x27;t much better, as the old networkers shanty goes: &quot;backhoe, backhoe, digging deep — make the backbone go to sleep&quot;.
评论 #28055661 未加载
babelfishalmost 4 years ago
fly.io has a fantastic engineering blog. Has anyone used them as a customer (enterprise or otherwise) and have any thoughts?
评论 #28053720 未加载
评论 #28055670 未加载
评论 #28054312 未加载
评论 #28053922 未加载
评论 #28057929 未加载
评论 #28053718 未加载
评论 #28056636 未加载
vmceptionalmost 4 years ago
&gt;The term &quot;CDN&quot; (&quot;content delivery network&quot;) conjures Google-scale companies managing huge racks of hardware, wrangling hundreds of gigabits per second. But CDNs are just web applications. That&#x27;s not how we tend to think of them, but that&#x27;s all they are. You can build a functional CDN on an 8-year-old laptop while you&#x27;re sitting at a coffee shop.<p>huh yeah never thought about it<p>I blame how CDNs are advertised for the visual disconnect
评论 #28055792 未加载
daniel_iversenalmost 4 years ago
Years ago I was involved with some high performance delivery of a bunch of newspapers, and we used Squid[1] quite well. One nice thing you could do as well (but it&#x27;s probably a bit hacky and old school these days) was to &quot;open up&quot; only parts of the web page to be dynamic while the rest was cached (or have different cache rules for different page components)[2]. With some legacy apps (like some CMS&#x27;) this can hugely improve performance while not sacrificing the dynamic and &quot;fresh looking&quot; parts of the website.<p>[1] <a href="http:&#x2F;&#x2F;www.squid-cache.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.squid-cache.org&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Edge_Side_Includes" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Edge_Side_Includes</a>
chrisweeklyalmost 4 years ago
This is so great. See also <a href="https:&#x2F;&#x2F;fly.io&#x2F;blog&#x2F;ssh-and-user-mode-ip-wireguard&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fly.io&#x2F;blog&#x2F;ssh-and-user-mode-ip-wireguard&#x2F;</a>
3npalmost 4 years ago
As someone who’s mostly clueless about BGP but have a fair grasp of all the other layers mentioned, I’d love to see posts like this going more in depth on it for folks like myself.
youngtaffalmost 4 years ago
Some of the things they miss in the post are Cloudflare uses a customised version or Nginx, same with Fastly for Varnish (don&#x27;t know about Netlify and ATS)<p>Out of the box nginx doesn&#x27;t support HTTP&#x2F;2 prioritisation so building a CDN with nginx doesn’t mean you&#x27;re going ti be delivering as good service as Cloudflare<p>Another major challenge with CDNs is peering and private backhaul, if you&#x27;re not pushing major traffic then your customers aren&#x27;t going to get the best peering with other carriers &#x2F; ISPs…
评论 #28054376 未加载
jusssialmost 4 years ago
&gt; 3. Be like a game server: Ping a bunch of servers and use the best. Downside: gotta own the client. Upside: doesn&#x27;t matter, because you don&#x27;t own the client.<p>&quot;If you can run code on it, you can own it&quot;. Your front page could just be a tiny loader js that fires off a fetch() for a zero byte resource to all your mirrors, and then proceeds to load the content from the first responder.
评论 #28061546 未加载
cpascalalmost 4 years ago
&gt; DNS: Run trick DNS servers that return specific server addresses based on IP geolocation. Downside: the Internet is moving away from geolocatable DNS source addresses. Upside: you can deploy it anywhere without help.<p>Can anyone expand on how&#x2F;why &quot;the Internet is moving away from geolocatable DNS source addresses&quot;?
评论 #28061805 未加载
Rd6n6almost 4 years ago
Sounds like a fun weekend project
ksecalmost 4 years ago
It is strange that you put a Time duration in front of CDN ( content delivery network ), because given all the recent incident with Fastly, Akamai and Bunny, I read it as 5 hours Centralised Downtime Network.
intricatedetailalmost 4 years ago
Does Nginx still not support cache invalidation? If you setup long TTL, is there a way to remove some files from cache without nuking entire cache and restarting an instance?
评论 #28056124 未加载
cortesoftalmost 4 years ago
The hard part of building a CDN is not setting up an HTTP cache, it is setting up an HTTP cache that can serve thousands of different customers.
评论 #28056166 未加载
legrandealmost 4 years ago
I like to blog from the raw origin and not use CDNs because if a blogpost is changed I have to manually purge the CDN cache, which can happen a lot. Also CDNs have the caveat in that if they&#x27;re down, it can make a page load very slow since it tries to load the asset.
评论 #28053397 未加载
评论 #28053478 未加载
评论 #28055556 未加载
parenthesesalmost 4 years ago
Author has a great sense of humor. I love it!
mbStavolaalmost 4 years ago
Fly is great and I love reading their blog posts.<p>Just hoping they come back around on CockroachDB-- I feel like it&#x27;s a match made in heaven for what they&#x27;re providing.
评论 #28061587 未加载
评论 #28061597 未加载
ameliusalmost 4 years ago
Waiting for IPFS to shake this all up.