Everyone wants their website to be popular. You want to get your idea or product out there and the internet is a great way to do that. After a while of things going smoothly you start to get complaints – the website is slow, people in Europe are having a hard time downloading files, the server is getting overloaded. You need to start optimizing your website to provide a fast, consistent experience for everyone that visits.
There are a multitude of different things that one can do, and one of the easiest is to start using a Content Delivery Network, or CDN. For the most part setting up and using a CDN is much easier than attempting to rewrite a site to be horizontally scalable and can provide many different benefits.
What is a CDN?
A CDN is a collection of servers that share a set of static files or content and are usually geographically separated. The CDN takes care of incoming requests for a file, figures out which is the best server to use, and then routes the request to that server. A CDN might have a set of servers in the eastern US, the western US, Asia, and Europe. When a visitor from the UK visits your site, the CDN detects they are in Europe and will route requests for files to their European servers instead of the servers in the US.
There are two types of CDNs that can be used. One is a CDN service that sits in front of your website that routes all the requests to either other CDN servers or your own servers. Akamai is probably the best known CDN provider that does this. The second type is a CDN that hosts files and you point your application to that other set of servers for requests of static files.