Follow the cat home, nya~

Why I Choose Cloudflare as My CDN and DNS Provider

2025-07-214 min
CloudflareCDNDNSTech

Introduction

Choosing the right infrastructure provider is crucial when building personal projects. Today, I want to share why I chose Cloudflare as the CDN and DNS provider for my CayiHuo project.

My Use Cases

My project currently uses the following domains:

  • cayihuo.top - Main site
  • blog.cayihuo.top - Blog
  • projects.cayihuo.top - Projects showcase
  • chat.cayihuo.top - AI chat service
  • domains.cayihuo.top - Upcoming domain distribution service

All these domains require stable DNS resolution and CDN acceleration, which are the main reasons I chose Cloudflare.

Why Cloudflare

3.1 Free Plan is Powerful Enough

Cloudflare's free plan is more than enough for individual developers:

  • DDoS Protection - Unlimited DDoS mitigation
  • Global CDN - 200+ data centers worldwide
  • Auto HTTPS - Free SSL/TLS certificates
  • Basic WAF - Free tier includes basic firewall rules

For a personal project, these features are completely sufficient without any cost.

3.2 Excellent DNS Performance

Cloudflare's globally distributed Anycast network provides very fast DNS resolution:

  • Global average response time < 20ms
  • 99.999% availability guarantee
  • Automatic load balancing

3.3 One-Click SSL Certificates

Simply change your domain's NS servers to Cloudflare's provided servers, and SSL certificates are automatically configured:

  • Auto-renewal, no manual work needed
  • Custom certificate support
  • Multiple encryption modes available (Flexible, Full, Strict)

3.4 Flexible Page Rules

Through Page Rules, you can flexibly configure:

  • Caching strategies (Cache Everything, Edge Cache TTL)
  • URL redirects (301/302)
  • Access control (IP limits, geo-restrictions)

3.5 Workers Edge Computing

Cloudflare Workers provides edge computing capabilities:

  • Run code on 300+ global edge locations
  • No server management needed
  • Pay-per-request, free tier is enough for personal use

Comparison with Other Providers

FeatureCloudflareAlibaba CloudTencent Cloud
Free DDoS✅ Unlimited❌ Paid❌ Paid
Free CDN✅ Unlimited❌ Limited❌ Limited
SSL Certificate✅ Free Auto❌ Paid❌ Paid
DNS SpeedGlobal FastChina FastChina Fast
ConsoleModern & CleanAverageAverage
Workers✅ Free Tier❌ None❌ None

Configuration Demo

5.1 Domain Setup Process

  1. Register a Cloudflare account
  2. Add your domain
  3. Change domain's NS servers to Cloudflare's provided servers
  4. Wait for DNS propagation (usually a few minutes to 24 hours)

5.2 SSL/TLS Encryption Mode

Recommended: Full (strict) mode:

  • Client to Cloudflare: HTTPS
  • Cloudflare to origin server: HTTPS (requires SSL on origin)

5.3 Cache Rule Configuration

For static resources, configure:

URL pattern: *.cayihuo.top/*
Setting: Cache Level -> Cache Everything
Edge Cache TTL: 1 week

Practical Application in My Project

Combined with VPS + Docker deployment, my configuration:

  • All subdomains proxied through Cloudflare
  • Static resources use Cache Everything
  • API requests set Cache-Control: no-cache
  • Brotli compression enabled for better transfer efficiency

This not only improves access speed but also effectively protects the origin server.

FAQ

Q1: NS propagation taking too long?

Usually takes up to 24 hours for global propagation. Use dig or online tools to check resolution status.

Q2: Cache not working?

Check if page rules are configured correctly, and if the origin server returns proper Cache-Control headers.

Q3: Access blocked?

Check WAF rules for false positives, check if IP is on Cloudflare's threat score list.

Conclusion

For individual developers and small projects, Cloudflare offers an irresistible free tier:

  • Free and powerful security protection
  • Global CDN acceleration
  • Simple and easy-to-use console
  • Rich edge computing capabilities

If you're building a personal project too, I highly recommend trying Cloudflare.


Feel free to leave comments if you have any questions!

Copyright © 2023-2026 CaYiHuo's Blog. All rights reserved.