How a CDN works
Without a CDN, every visitor downloads every file from your server, wherever they are. With a CDN, the first visitor in a region causes the CDN to fetch a file from your server (the origin) and keep it. Later visitors in that region get it from the nearby CDN location, which is faster and saves your server the work.
What a CDN helps with
| Benefit | When it matters most |
|---|---|
| Faster loading for distant visitors | Your audience is spread across countries or continents |
| Less load and bandwidth on your hosting | Image-heavy sites, downloads, traffic spikes |
| Protection | Absorbing floods and filtering bad bots before they reach the server |
| Free or included HTTPS at the edge | Simplifies certificates for static hostnames |
A CDN does not fix a slow server response for pages that cannot be cached, such as carts and dashboards. Page caching and a fast server still matter. See our site speed guide.
Two ways to set up a CDN
| Method | How it works | Good for |
|---|---|---|
| Full-site proxy | Your domain’s DNS points to the CDN, which forwards requests to your server | Speed and protection for the whole site |
| Static hostname (pull zone) | Images, CSS and JavaScript load from a CDN hostname such as cdn.example.com | Offloading heavy files with minimal DNS changes |
Step-by-step setup
- Measure the current speed of key pages with PageSpeed Insights, so you can compare later.
- Choose the setup method and create the CDN zone, with your server as the origin.
- Update DNS: either change nameservers or add the CNAME the CDN gives you.
- For a static hostname, tell your CMS to use it, for example with a CDN plugin for WordPress.
- Set caching rules (below), and turn on HTTPS for the CDN hostname.
- Test pages logged in and logged out, and on a phone, then measure again.
Caching rules that work
- Cache for a long time: images, fonts, CSS and JavaScript with versioned file names.
- Cache briefly or not at all: HTML pages that change often.
- Never cache: admin areas, login pages, carts, checkout and account pages, and any request with a login or cart cookie.
- Purge after changes: clear the CDN cache when you update a design or replace files with the same name.
Security features to turn on
- ✓ HTTPS between visitors and the CDN, and between the CDN and your server.
- ✓ Hotlink protection, so other sites cannot embed your images at your cost.
- ✓ Bot and rate-limit rules for login and search pages.
- ✓ Make sure the origin firewall allows the CDN’s IP ranges and still sees real visitor IPs.
For a common setup on cPanel, see our Cloudflare and cPanel guide.
Which sites benefit most
| Site | Why |
|---|---|
| Online stores | Product images load faster; protection for checkout and login pages |
| Media and portfolio sites | Large images and downloads served close to visitors |
| Sites with an international audience | Distance is the main cause of slow loading for far-away visitors |
| Small local sites | Less benefit if visitors are near the server, but protection can still help |
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| Old files still showing | The CDN cache has the old version | Purge the file or the whole cache. |
| Logged-in users see others’ content | Personal pages were cached | Exclude account, cart and admin pages, then purge. |
| Mixed content warnings | Some files still load over HTTP | Use HTTPS URLs everywhere, and enable HTTPS on the CDN hostname. |
| Visitors blocked by the server | The firewall blocks CDN IP addresses | Allow the CDN’s ranges and restore real visitor IPs. |
UnderEDGE CDN
UnderHost offers its own CDN, UnderEDGE, which works with shared hosting, VPS and dedicated servers. See the product page in @CustomerPanel for current locations, limits and prices, or ask our team which setup suits your site.
Need help with this?
Want faster pages worldwide? Ask our team about UnderEDGE CDN for your site.
Frequently asked questions
Does a CDN work with shared hosting?
Yes. A CDN sits in front of any hosting type, including shared hosting.
Will a CDN improve my SEO?
Indirectly. Faster pages improve Core Web Vitals and the visitor experience, which search engines take into account.
Which pages should a CDN not cache?
Admin, login, cart, checkout and account pages, and any request from a logged-in user.
Do I need to change nameservers to use a CDN?
Only for a full-site proxy. A static hostname needs just a CNAME record.
How do I clear the CDN cache?
Use the purge option in the CDN dashboard, for one file or the whole site.
Related guides
- How to Use Redis Manager in cPanel to Boost Website Speed
- Clean Malware and Restore Your Hacked Website with Hourly Server Management
- Node.js Security Update (October 2026): CVE-2026-111497
- PHP Critical Security Update (October 2026): Patch Guide, CloudLinux Status, CERT-EU Advice and Mitigations
- Imunify360 vs cPGuard: Which Security Suite Fits Your Hosting Needs?
