liveBook · Manning

CDN

As explained in Building Web APIs with ASP.NET Core

A content delivery network is a geographically distributed network of intermediary servers that delivers or caches content from locations closer to clients.

A content-delivery network (CDN) is a geographically distributed network of proxy servers. It sits between clients and a web server, helping deliver content with higher availability and better performance. Its intermediate cache can reduce latency and the bandwidth used by the origin server. section 8.1 section 3.1.4

Figure 3.3 Updated MyBGList SOA using CDN and reverse proxy
03-03

The architecture diagram places a CDN and a reverse proxy between clients and the board-game API. The API still handles requests and data exchange, while the added layers can cache responses before requests reach it. section 3.1.4

For a production API, choosing a CDN means choosing an intermediate layer instead of binding the public domain directly to the web server’s IP address. Requests reach the CDN first and are then forwarded to the origin server. Depending on the provider and plan, the CDN may also mask the origin IP address, filter malicious requests with a web application firewall, and mitigate DDoS attacks. These benefits come with extra configuration and architectural complexity. section 12.1.3

Decide what the CDN should cache before relying on it:

  • For a mostly static site, consider browser or CDN HTTP caching for HTML, CSS, JavaScript, and images. section 8.1
  • For a RESTful API, consider HTTP response caching for frequently accessed GET endpoints or default-parameter requests. When clients request varied, specific data, server-side caching may do more to relieve the database. section 8.1

Board-game API deployment

The board-game website is hosted on a CDN, while a separate CDN layer is proposed in front of its API. For the API deployment, the goal is to serve content without directly exposing the hosting server and to support a secure edge-origin arrangement with encryption between the server and users’ browsers. Provider setup is a practical deployment task, not an API code change. section 1.1.2 section 3.1.4 section 12.5

A CDN is not equally useful for every protocol: gRPC responses are difficult to cache through intermediaries such as CDNs. Check the API’s request patterns and caching needs before treating an added layer as an automatic performance improvement. section 10.3.2 section 8.1

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines the CDN and explains deployment trade-offs and common protections, without detailing a provider’s complete configuration sequence.
Examples
Uses a CDN-hosted board-game website and an architecture diagram placing CDN and reverse-proxy layers before its API.
What it assumes
Assumes a web API and deployment scenario, while defining a CDN before discussing its caching role.
What you can do after
Evaluate/understand whether CDN caching and security benefits justify an intermediate layer for an API deployment.
How it connects
Connects CDNs to reverse proxies, HTTP response caching, edge-origin architecture, web application firewalls, and DDoS protection.

Also explained in

Compare how 4 books explain CDN →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.