Before we get into the details of a CDN, we need to know this life fact: DISTANCE MATTERS!
Yes, the distance between the server and the client matters. The further away the client will be from the server, the longer it would take for the server to respond to the client.
Having this fact in mind, what the CDN providers do is that they place their servers all over the WORLD 🌍!
They would be having servers in Africa, servers in Europe, servers in America, and basically in all countries and regions.
So let's say a user from Africa requests some data from a website hosted in America, the request would first go to a server that is nearest to the client to check to see if the data is present there, if it's not, then it will go all the way to America and fetch the data from the main server and then cache it on it's way back before handing it to the client.
As long as the data is cached, it will be served from the CDN server to all the users requiring the same data. This not only speeds up the delivery but also frees up your main server from resources so that it can attend to more critical requests!
Top comments (0)