How to make a CDN

I am not really sure if its even possible, but is there some kind of Open-Source Self-Hosted CDN software? I’m new to this so please don’t bully me on the comments.

@southerntofu
link
105M

Hello! A CDN is just a webserver, with some extra configuration at the network level.

If you’re unfamiliar with how BGP routing works between Internet operators, all you have to know is that each operator (AS - Autonomous System) has links to others, and can decide:

  • where through to route its own traffic to other AS (eg. your AT&T ISP may have a direct route to OVH (where lemmy.ml is hosted), or may go through a 3rd party transit provider like Level3 (for a much higher cost)
  • in which Points of Presence (PoPs) to advertise which routes to its own network ; you can advertise address 1.2.3.4 only from your Paris PoP and let other AS find the best route to you, and at the same time advertise address 1.3.1.2 from Paris, Moscow, Beijing, etc…

A CDN is more or less an IP address announced from many places, pointing to different servers depending on where you access it from, but with a single TLS certificate for HTTPS. So if you try to reach it from AT&T, you’ll get traffic directed to a datacenter in USA, etc…

So, on a system level, it’s REALLY easy to deploy a CDN. It’s just a webserver. On a network level, it’s more complicated because you need your own IP block that’s announced on your own network. In fact, that’s not entirely true as you can find (very costly) network operators that’ll do that for you.

Did i answer your question? :)

Zoë Tech Corner
creator
link
15M

This did explain to me what a CDN is/how it works yes! Thank you! I just have now to learn or try to understand exactly how could this possibly be set up.

poVoq
link
75M

https://ipfs.io/ kinda works like a CDN, but it is probably not what you are looking for.

I think there was some open source javascript based CDN software, but I forgot the name. Sorry.

Zoë Tech Corner
creator
link
15M

I’ll check it later, thank you!

@ajz
link
65M

Yes, you can run for example Nginx or Varnish or Caddy web server software to serve static content like images and java script files. Here an example.

https://www.nginx.com/blog/learn-to-stop-worrying-build-cdn/

Zoë Tech Corner
creator
link
25M

I’ll have a look when i have some free time, thx!

@Echedenyan
link
15M

Apache HTTP Server with load_balancing modules can work like it too.

There is also HAProxy.

@hburb3ri
link
45M

You don’t self-host a CDN. The CDN is hosting around the world so users connect to closer servers.

poVoq
link
45M

A sefhosted network of cdn servers would be cool though. Basically a more generalized webtorrent.

Zoë Tech Corner
creator
link
25M

In this case of self-hosting I mean my self managing the CDN network, even if its like let’s say Linode hosting it for example, instead of beying like cloudflare CDN.

@Nevar
link
4
edit-2
4M

deleted by creator

@Echedenyan
link
35M

Or mount a community network to support FLOSS services between each one.

Zoë Tech Corner
creator
link
25M

For now I’m just trying to understand how it works, and how is it possible to make one. But something like website hosting (which I do believe is in the file storage category)

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

  • Posts must be relevant to the open source ideology
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

  • 0 users online
  • 49 users / day
  • 95 users / week
  • 155 users / month
  • 500 users / 6 months
  • 3808 subscribers
  • 1316 Posts
  • 4109 Comments
  • Modlog