How CDN works

How CDN works

Content delivery networks (CDNs) are handling the static assets of a website. Static assets are the files that are not frequently change like css files, javascript files, image files etc. Because these files are not change frequently we can  cache them and replicated them across cdn edge servers.These edge servers are distributed across the world. Every time a user request a file the CDN algorithm find the closest geographically server to the user and serve the file and cache it.

 

When your content is stored on a CDN, it is distributed across the network’s servers, and the content is delivered from the optimum location for that user. The CDN uses an algorithm to determine whether the best location is:

  • the server from which it will take the fewest hops to deliver the content
  • the server whose distance is the least number of network seconds from the requesting client
  • the server with the highest availability in terms of server performance.

 

Some techniques that a CDN will employ include:

Caching – the CDN will store popular content on servers that have the greatest demand for that content.

Load balancing – traffic is shared over multiple servers or web caches.

Request routing – directs client requests to the content source best able to serve the request. This could be the closest node, or the one with the greatest capacity.