Content Delivery Networks also known as CDN is a system made up of distributed servers which deliver content to users from the closest server based on their geographic locations. For example, if a user is accessing a server or connecting to a website which has its server on the other side of the world it would take time to load all the content due to the ping, however, if the content is on a CDN then based on the CDN provider it could be at a much closer locations to the users which would reduce their overall ping and reduce the loading time even further. To make it explicitly clear, a CDN is not an alternative host. The purpose of a CDN is to replicate content from a host to closer servers to users based on geographical location. So, in other words, it is important to have a good host regardless of using a CDN or not.
Since CDNs are essentially a network of servers that are linked together with the sole purpose of providing content as quickly, reliably, and securely as possible they communicate using Internet Exchange Points (IXPs), which are, primarily locations where the Internet Service Providers (ISPs) connect to, so they may exchange information between each other. By having connections to these high-quality locations, it is possible for CDN providers to reduce cost and transit times when delivering content to the users on request. Other than IXPs CDNs make several other optimizations on both client and server-side data transfers.
The few primarily advantages of CDNs are High-Speed Delivery, Reduced Bandwidth, Increased Availablity & Redundancy, Improved Security, and Assent Delivery Control. Since the CDN can deliver data from a closer location it is able to provide the data faster which ends up resulting in users waiting less and accessing information faster. This means users are less likely to leave to multi-task. By using caching data that are constantly loaded it is possible to send users cached data and use other optimization methods to significantly decrease bandwidth on the hosting meaning fewer resources will be used, and more connections may be allowed without the server providing an error. Availability and Redundancy are one of the most crucial aspects of any system and with a CDN the uptime of a website is always 100%. The reason for this is because since the CDN is a distributed server this means all the data on one server will go to other servers to deliver from the closest location of the user. However, though the primary intent is to send data from the closest server it also has an ulterior motive which is in case of the primary server failing the server will still be able to be accessed due to other servers temporarily becoming primary servers till the primary server gets restored. In other words, the server on a CDN will always be online unless the CDN itself goes down (which is not likely). Security is a big part of our society especially considering everything is vulnerable and digital nowadays. Most CDN providers have several different security measures in places and with some, you can upgrade to a higher tier to get even more security features. A few examples are, SSLs, DDOS Mitigation, Security Questions, etc. Lastly, you can control the assets being sent. In other words, you will have the ability to prevent certain assets from being tied into the CDN or vice versa. A few disadvantages of a CDN is Possible Additional Cost, Support Issues, and Geolocation Tricks. Though there are free CDNs out there it is not always free. There may be additional services you may be interested in that may not be free and could become an additional charge. It can get costly but usually, the bare minimum is more than enough. Since CDN is so efficient and useful usually most people and company use third-party vendors to run and support their CDN. The problem with this is if big problems occur there might be several challenges on trying to fix the problem fast and all at once. Meaning it may take a few times of trial and error to identify all the issues and fix them. Lastly, geolocation tricks can be a big issue, primarily because if the CDN provider does not offer a server in or close to an area you wish to target or where most of the traffic is coming from then it would take much longer for the server to be accessed and if this is the case it would be smarter to not use a CDN and rather use the regular server as it would be much faster and ideal.
We have tried several different CDN providers and out of all of them, our favorite and the one we would recommend would be Cloudflare. Since they have a free version which is normally enough for most servers it makes sense. To explain, you could set up Cloudflare with any website for free and automatically without spending a dime you would get a free SSL, CDN Caching, Server-Side Content Optimization, Speed Optimization, Basic DDOS Protection, and several other things. The best part is using Cloudflare normally ends up saving money per year. It is not normally a lot but still something.