Setting Up Cloudflare CDN for Your Website
Why Use Cloudflare CDN?
Cloudflare operates a globally distributed network, partnering with local ISPs to deploy data center resources at backbone nodes worldwide. This gives Cloudflare excellent bandwidth capacity and helps balance origin server traffic.
- Offload server traffic and I/O — Static files are cached at the nearest CDN edge node and delivered from there, reducing load on your origin.
- Hide your real server IP — Cloudflare acts as a reverse proxy, shielding your origin from DDoS attacks and intrusion attempts while adding a layer of security on top of performance.
- Free HTTPS — SSL/TLS certificates are provisioned automatically at no cost.
Note: Cloudflare's free tier has no traffic or request limits, which is why I chose it as my primary CDN. Note: Due to unresolved peering agreements with Chunghwa Telecom, users on that ISP may be routed to a US West Coast edge node.
How Cloudflare CDN Works
Cloudflare is built on top of a reverse proxy architecture, so you need to delegate your DNS management to Cloudflare.
1. Client requests a static file → Cloudflare DNS → nearest CDN cache → response returned to client.
2. Client requests dynamic data → Cloudflare DNS → your origin server → response returned to client.
Setup Steps
1. Create an Account

2. Add a Site — Enter Your Domain

3. Select the Free Plan

4. Continue

5. Delegate DNS to Cloudflare — You will be prompted to update your nameservers to point to Cloudflare

6. Enable Auto-Minify for Static Assets

7. Setup Complete

8. Enable HTTPS — Wait a few minutes. All requests under this domain will then be served through Cloudflare CDN with HTTPS.

9. Once active, response headers for static file requests will include Cloudflare-specific fields

10. Check which CDN node you are connected to — look at the colo field
https://yourdomain/cdn-cgi/trace

11. You can also use tracert to see the route your traffic takes
tracert markkulab.net

Additional Tips
1. Enable Development Mode to temporarily bypass the CDN cache





























Comments