Chapter 2. Leveraging a CDN

Browser cache is a great tool, and I would say table stakes for starting to create a frontend, scalable site. But when your traffic and performance goals demand more, it is usually time to step up to partnering with a content delivery network (CDN). This chapter we look at leveraging a CDN to both improve your performance and offload the number of requests via proxy caching at the edge, called edge caching.

The purpose of a CDN is to provide availability and performance for content served over the Internet. There are several ways that this is accomplished, from providing Global Traffic Management (GTM) services to route content to the closest or fastest data center, to providing edge serving.

Edge Caching

Edge serving is where a CDN will provide a network of geographically distributed servers that in theory will reduce time to load by moving the serving of the content closer to the end user. This is called edge serving, because the serving of the content has been pushed to the edge of the networks, and the servers that serve the content are sometimes called edge nodes.

To visualize the benefits of edge computing, picture a user who lives in Texas trying to access your content. Now you don’t yet use a CDN, and all of your content is hosted in your data center in Nevada. In order for your content to reach your user, it must travel across numerous hops, with each hop adding tens or even hundreds of milliseconds of latency.

See Figure 2-1 for a request ...

Get Intelligent Caching now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.