How to build your own CDN

Data transfer is freakishly expensive, especially if you're using cloud storage. At ArtStation, we bootstrapped our infrastructure to millions of users every month pushing > 300TB/month in traffic on an extremely tight budget. I'll explain how a CDN works, how to make one with commodity servers with multiple points of presence worldwide, and even when using a commercial CDN, why having your own caches is useful and reduces costs massively.