Chapter 9. Content Delivery Networks

 

This chapter covers

  • CDN options
  • Domain sharding
  • Developing with a CDN

Every time you open a browser and request a URL, you’re connecting to a server that could be located thousands of miles away. Each request you make might have to make a round-trip to a server that’s halfway around the world! If you host your website in a data center in New York and a user connects to your site from Sydney, each HTTP request travels a very long distance. Each round-trip takes time, and even though it may only amount to milliseconds, it all adds up.

It’s important to keep in mind who might be accessing your website—and from where. While the majority of users might be located in your own country, your website can be accessed by users who live elsewhere. A Content Delivery Network (CDN) allows users to access content on servers that are relatively close to them, minimizing the distance a request travels and reducing your site’s web page load times. A CDN improves your chances of serving the same website experience to all your users, regardless of their location. Happy users = happy developers!

9.1. What is a Content Delivery Network?

Content Delivery Networks, or CDNs as they are better known, are a collection of server nodes located around the world that contain a clone of your site’s static files. Because static files such as images, JavaScript, and CSS don’t change often, they’re ideal for CDNs.

9.2. CDN options

9.3. Domain sharding

9.4. Developing with a CDN

9.5. The results

9.6. Summary