Should you use a CDN to get more speed?
It is a good question, will your website be faster, or will it be slower? Let us look at the basics why to use and why not to.
First, how many visitors do you have, and are you expecting many more, and where are they coming from? Are you using some analytics tool to know?
A CDN is usually just a cache on the way to the visitor, a cold empty cache will slow down in most cases, a warm full cache will speed up and take load off your server, a modern website has capability of http/2 or even http/3 together with TLS1.3, so why go via a cold cache that gives double connection setup and in worst case http/1.1 to your backend?
(Client) — http/2—> (CDN) — http/1.1 —> (Origin server)
(Origin server) — http/1.1 —>(CDN)— http/2 —> (Client)
VS no CDN, just doesn’t matter what one believes, this is just faster
(Client) — http/2 —> (Origin server)
(Origin server) — http/2 —> (Client)
And of course, even better if you have http/3 available to visitors, I have seen many company websites with quite low numbers of visitors, few have over a 1000 per months, and they have a lot of pages, images and so on, that simply means one will have a cold cache in most cases.
“On the lower end of the spectrum – 13% of local businesses receive fewer than 100 visitors to their sites each month, while 55% receive fewer than 500. On the higher end, 20% of businesses receive more than 1500 monthly visitors to their site, and 15% receive over 2500 visitors”
But if you have pages that run a lot of visitors and the cache on the CDN is taking the load, yeah that’s the thing for you, go for a CDN.
So what is the solution otherwise? Well carefully choose a shared hosting or Cloud hosting or even a dedicated server depending on the complexity of your site, or a mix of them, there are CDN providers with storage to, maybe store those heavy files on the CDN.
And one can also choose Cloudflare because they have so many other features, almost like a Swiss army knife of stuff not only related to speed, but I will also make a special post on them soon.
Happy new year