A content delivery network (CDN) caches your website’s files on servers around the world, so visitors download them from a nearby location instead of from your origin server every time. Putting a CDN in front of a dedicated or self-hosted server makes sites faster for distant visitors, reduces load and bandwidth on your server, and adds a layer of security.
What a CDN does for your server
| Benefit | How it helps |
|---|---|
| Speed | Static files such as images, CSS and JavaScript load from an edge location close to the visitor |
| Lower server load | Cached requests never reach your origin, freeing CPU and bandwidth |
| Resilience | Some CDNs can serve cached pages if the origin is briefly unavailable |
| Security | Many CDNs include DDoS protection and a web application firewall |
| Lower bandwidth costs | Less outbound traffic from your own connection |

How to integrate a CDN step by step
- Choose a provider with points of presence near your audience. For South African visitors, check for edge locations in Johannesburg and Cape Town.
- Set the origin to your server’s address.
- Update DNS: either move DNS to the CDN (common with reverse-proxy CDNs) or point a CNAME such as www or a static subdomain at the CDN.
- Configure caching: cache static files for a long time, bypass caching for logged-in users, carts, checkouts and admin areas.
- Enable HTTPS between visitors and the CDN, and between the CDN and your origin.
- Lock down the origin so it only accepts web traffic from the CDN’s IP ranges.
- Test pages, forms, logins and checkout, then monitor cache hit rates.
Common issues
| Problem | Likely cause | Fix |
|---|---|---|
| Changes not showing | Cached old content | Purge the CDN cache or use versioned file names |
| Redirect loops | HTTPS settings mismatch between CDN and origin | Use full or strict TLS mode with a valid origin certificate |
| Visitor IPs all look the same in logs | Server sees the CDN, not the visitor | Read the visitor IP from the header the CDN provides |
| Forms or logins break | Dynamic pages cached | Bypass cache for those paths and for logged-in users |
Related: DDoS mitigation, reducing latency and load balancing.
Frequently asked questions
What is a CDN?
A content delivery network is a network of servers in many locations that caches and delivers website content from the location closest to each visitor.
Do I need a CDN for my website?
If you have visitors far from your server, heavy images or media, or traffic spikes, a CDN usually helps. Small local sites may see less benefit.
Can I use a CDN with a dedicated server?
Yes. Your dedicated server becomes the origin, and the CDN sits in front of it to cache and protect content.
Does a CDN help with DDoS attacks?
Many CDNs include DDoS protection and absorb attack traffic, provided your origin server is not reachable directly.
Need a fast origin server? Configure a refurbished server or ask our team.


