A content delivery network (CDN) is a group of servers spread across many cities and countries that keep copies of your website's files. When someone opens your site, those files come from a CDN server near them instead of travelling all the way from your main server. The usual result is faster loading, less strain on your hosting and better resilience when traffic suddenly rises.
An everyday comparison
Imagine a company that makes biscuits in one factory near Dhaka. If every shop in the country had to order directly from the factory, deliveries to Rangpur or Cox's Bazar would be slow. So the company keeps stock in depots around the country, and each shop gets supplies from the nearest depot.
Your hosting server is the factory. CDN servers, often called edge servers, are the depots. The depots do not make anything new; they hold copies of what the factory has already made. When the product changes, the depots need fresh stock.
How it works, step by step
- You connect your domain to the CDN, usually by changing a DNS setting or switching it on from your hosting panel.
- A visitor in, say, Sylhet requests your home page.
- The request goes to a nearby CDN server. If that server already holds a copy of the files, it sends them straight away.
- If it does not, it fetches them from your main server, called the origin, passes them to the visitor and keeps a copy for the next person.
- Copies are kept for a set time, then refreshed from the origin.
The files a CDN handles best are the ones that are the same for everyone: images, videos, style sheets, scripts and fonts. Some CDNs can also store whole pages that do not change from one visitor to the next.
What a CDN helps with
- Distance. Files travel a shorter path to the visitor. This helps most when your server is far from your audience; see hosting in Bangladesh or abroad.
- Load on your server. Your hosting answers fewer requests, leaving more capacity for work only it can do, such as processing orders.
- Traffic spikes. When a campaign or a viral post sends a crowd, copies spread across many servers absorb much of the rush.
- Some security. Many CDNs filter certain kinds of attack traffic before it reaches your server, and many also handle HTTPS for you.
What a CDN does not fix
A CDN is not a cure for every slow site.
- Heavy pages stay heavy. If your home page carries oversized images and scripts from a dozen plugins, a CDN delivers that weight faster, but it is still weight. Start with image optimisation and the basics in fixing a slow website.
- Personal pages still go to your server. A cart, checkout, account page or dashboard is built for each visitor and usually cannot be stored. If your server is slow to build these, the CDN cannot help much.
- Nearby locations vary. Whether a CDN has servers in or near Bangladesh depends on the provider. Check its published list of locations rather than assuming.
Common questions
I updated my site, but visitors still see the old version. Why?
The CDN is still serving its saved copy. Most CDNs have a "purge" or "clear cache" option that removes old copies. Your developer can also set things up so that updated files get new names and are fetched fresh automatically.
Does a CDN replace my hosting?
No. For a normal business website you still need hosting as the origin; the CDN sits in front of it.
Will a CDN improve my Google ranking?
Only indirectly, by making pages load faster for real visitors. Speed is one of many factors, and a CDN will not make up for thin or unhelpful content.
Is it hard to set up?
A basic set-up is often simple, but mistakes in DNS or caching rules can break forms, logins or carts. Test the checkout, contact forms and admin area after switching it on.
Does your business need one?
A CDN is worth considering if your server is far from your visitors, your pages carry many images or videos, you run campaigns that bring sudden crowds, or you serve buyers in several countries. A small local site on a nearby, well-run server may see little difference, and that is fine.
Before switching one on, note your current page speed on a phone using mobile data. Then enable the CDN, test every form and the checkout, and measure again. If you would like help deciding, or with the set-up itself, my web development service covers it.