Deploying a Static Site to a CDN

Strategic CDN hosting for global accessibility

When talking about a CDN, we’re referring to a geographically distributed network of data centers used to achieve high availability and performance when serving content to users in any part of the world.

To keep it simple, let’s give an example. Suppose Person A lives near Milan, Italy, and they want their web application to be used in potentially any part of the world. So, where should they host it from a geographical point of view?

Certain providers, such as Amazon AWS, DigitalOcean, and Microsoft Azure (and many more), will let us choose a specific data center to serve our application from. For example, we could select AWS eu-south-1 (Milan, Italy), ap-northeast-2 (Seoul, South Korea), or sa-east-1 (São Paulo, Brazil).

If we choose to serve Person A’s web application from Milan, Italian users will notice a very low latency when trying to reach the web application because it’s geographically located very close to them. The same could happen for French, Swiss, and German users, but for people living in Asia, Africa, or the Americas, it will be the opposite. The further we are from the data center, the greater the latency, leading to lousy performance, poor client-to-server request latency, and so on. If we think of static assets, such as images, CSS, or JavaScript files, this will be even clearer.

Get hands-on with 1200+ tech skills courses.