CDN
CDN (Content Delivery Network) is a network of servers spread across various geographic locations, designed to serve your website content from the server closest to visitors.
The result: the website feels faster for visitors wherever they are.
Simple analogy
Imagine you sell products from a warehouse in Jakarta. Buyers from Surabaya, Medan and Makassar have to wait longer because the distance is far. Then you open distribution points in every major city — buyers now receive products faster because they are taken from the nearest warehouse, not from Jakarta.
CDN works exactly like that, but for your website files: images, CSS, JavaScript, and videos.
How It Works
Without a CDN, every visitor downloads content directly from your website's main server — wherever that server is located. If the server is in Singapore and the visitor comes from Brazil, the distance affects the loading speed.
With C
DN:
- Your website's static files are copied to all CDN servers in various countries (edge servers)
- When visitors open a website, the CDN detects their location
- Files are served from the nearest edge server
- The primary server only handles dynamic content that cannot be cached
What Content Does a CDN Distribute?
CDNs generally handle static assets — the same content for all visitors:
| Content Type | Example |
|---|---|
| Image | JPG, PNG, WebP, SVG |
| CSS & JavaScript Files | Stylesheets, plugin scripts |
| Video & Audio | Embedded media files |
| Font | Web fonts from Google Fonts or self-hosted |
| Download files | PDF, documents, ZIP archives Dynamic content such as personalized pages or database query results are still processed on the main server. |
Benefits of Using CDN
Better loading speed — Visitors get files from nearby servers, rather than from a single point that may be geographically far away. This directly impacts Time to First Byte (TTFB) and PageSpeed scores.
Reduced server load — Because static assets are served by a CDN, your primary server doesn't need to process every file request. This is important when traffic spikes.Higher availability — If the primary server is down, the CDN can still serve cached versions of your content to visitors.Basic DDoS protection — Many CDN services include a layer of protection against small to medium-sized DDoS attacks as a built-in feature.
Commonly Used CDN Services
| Services | Description |
|---|---|
| Cloudflare | Most popular, free plan available, easy to integrate |
| BunnyCDN | Pay per use, competitive pricing, popular with developers |
| KeyCDN Suitable for | websites with high traffic and lots of media assets Amazon CloudFront Part of the AWS ecosystem, flexible but more technical For small to medium scale Indonesian websites, Free Cloudflare package provides significant benefits. |
What You Need to Pay Attention to
- Cache purge on update — After updating images or files on the website, make sure the CDN cache is purge so that visitors get the latest version, not the old version stored on the edge server.
- CDN is not a good replacement for hosting — CDN speeds up the delivery of static assets, but cannot fix a server that is slow to process PHP or an unoptimized database.
- Pay attention to the edge server location — Choose a CDN that has edge servers in Southeast Asia if the majority of your visitors come from Indonesia and surrounding areas.
- HTTPS must be active first — Most modern CDNs require SSL to be active on your domain before they can be used.
FAQs
Is CDN mandatory for all websites?
Not required, but highly recommended if your website has a lot of image assets, visitors from various regions, or is experiencing loading speed problems. For local websites with small traffic and the majority of visitors from one city, the benefits may not be very pronounced.
Is free Cloudflare really enough?
For most small to medium business websites, yes. Cloudflare's free plan includes global CDN, basic DDoS protection, and automatic SSL. Paid plans are required if you need advanced analytics, custom firewall rules, or higher routing priorities.
Can activating CDN damage my website?
If configured correctly, no. However, the most common mistake is forgetting to do a cache purge after updating content, so that visitors see an old version of the website. Always test the website after activating the CDN for the first time.
How to enable CDN in WordPress?
The easiest way is to connect the domain to Cloudflare — just change the domain nameservers to Cloudflare nameservers, and the CDN is activated automatically for the entire website. Alternatively, use a plugin like WP Rocket or LiteSpeed Cache that have built-in CDN integration.
Disclaimer: Hosting Wiki articles are prepared for educational and reference purposes. Hosting technology keeps evolving, so some technical details may change over time.