Cloudflare คืออะไร ตั้งค่าอย่างไร Free Plan ได้อะไรบ้าง
What is Cloudflare? How it works, free plan features, DNS and CDN setup for your Thai website.
สารบัญ
Cloudflare คืออะไร
Cloudflare เป็นบริษัทที่ให้บริการ CDN, DNS, DDoS Protection และ Security สำหรับเว็บไซต์ ทำหน้าที่เป็น Reverse Proxy ที่อยู่ระหว่างผู้เข้าชมและเซิร์ฟเวอร์ของคุณ มี Free Plan ที่ให้ Feature มากมายสำหรับเว็บไซต์ทั่วไปโดยไม่มีค่าใช้จ่าย
Cloudflare is a company providing CDN, DNS, DDoS protection, and security for websites. It acts as a reverse proxy between visitors and your server. The Free plan offers extensive features for regular websites at no cost.
- CDN: 310+ เมือง ทั่วโลก
- DNS: Name Server ฟรี ตั้งค่าง่าย
- DDoS Protection: ป้องกันอัตโนมัติ
- SSL ฟรี: ทุก Plan รวมถึง Free
- WAF: Web Application Firewall (บาง Feature ฟรี)
Cloudflare ทำงานอย่างไร
เมื่อผู้เข้าชมพิมพ์ URL เว็บคุณ DNS ชี้ไปที่ Cloudflare ก่อน Cloudflare ตรวจสอบว่า Content มีใน Cache ไหม ถ้ามีส่งจาก Data Center ใกล้ผู้เข้าชมเลย ถ้าไม่มีไปดึงจาก Origin Server แล้ว Cache ไว้ ระหว่างทางกรอง DDoS และ Bot ด้วย
When visitors access your site, DNS points to Cloudflare first. Cloudflare checks if content is cached — if yes, serves it from the nearest data center; if not, fetches from your origin server and caches it. DDoS attacks and bots are filtered during this process.
- Request → Cloudflare Edge (ใกล้ผู้เข้าชม)
- Cloudflare ตรวจ Cache → ส่งทันทีถ้ามี
- Cache Miss → ไปดึงจาก Origin Server
- Filter DDoS/Bot ก่อนส่งถึง Origin
- SSL Terminate ที่ Edge → HTTPS ครบ
Cloudflare Free Plan ได้อะไรบ้าง
Free Plan ของ Cloudflare มี Feature มากมายสำหรับเว็บทั่วไป ได้แก่ CDN, DDoS Protection, Free SSL (Auto), DNS Management, Analytics พื้นฐาน, Workers (100,000 Request/วัน), Pages (Static Site Hosting), R2 Storage และ Turnstile (CAPTCHA Alternative)
Cloudflare Free Plan includes extensive features: CDN, DDoS protection, free auto-SSL, DNS management, basic analytics, Workers (100k requests/day), Pages (static site hosting), R2 storage, and Turnstile (CAPTCHA alternative).
- CDN 310+ เมือง: ฟรี ไม่จำกัด Bandwidth
- DDoS Protection L3/L4: ฟรีทุก Plan
- Free SSL: Auto-renew ไม่ต้องทำอะไร
- DNS Nameserver: ฟรี เร็วที่สุดในโลก
- Workers: 100,000 Request/วัน ฟรี
การใช้ Cloudflare DNS
หนึ่งใน Feature ที่คนใช้มากที่สุดคือ DNS ของ Cloudflare ซึ่งเร็วที่สุดในโลก (1.1.1.1 Resolver) ย้าย Nameserver มา Cloudflare แล้วจัดการ DNS Record ทั้งหมดผ่าน Dashboard ได้ทันที DNS Propagation เร็วกว่าผู้ให้บริการอื่นมาก
One of Cloudflare's most-used features is its DNS — the world's fastest resolver (1.1.1.1). Move your nameservers to Cloudflare and manage all DNS records through the dashboard instantly. DNS propagation is much faster than other providers.
- Propagation เร็ว: หลักวินาที ไม่ใช่ชั่วโมง
- DNS Record ทุกชนิด: A, AAAA, CNAME, MX, TXT, SRV
- Orange Cloud (Proxy): เปิด CDN/DDoS Protection
- Grey Cloud (DNS Only): ไม่ผ่าน Cloudflare
- Automatic DNSSEC: ปกป้อง DNS Spoofing
CDN และ Cache บน Cloudflare
Cloudflare Cache Static Files เช่น รูปภาพ, CSS, JS อัตโนมัติที่ Edge ใกล้ผู้เข้าชม ลด Bandwidth Origin Server และทำให้ผู้เข้าชมโหลดเร็วขึ้น สามารถตั้งค่า Cache Rules เพื่อควบคุมว่าไฟล์ไหน Cache นานแค่ไหน
Cloudflare automatically caches static files (images, CSS, JS) at edge locations near visitors, reducing origin server bandwidth and improving loading speed. Cache rules let you control what gets cached and for how long.
- Static Files Cache อัตโนมัติ: รูป, CSS, JS
- Cache TTL: กำหนด Cache อายุได้
- Page Rules: ควบคุม Cache ต่อ URL Pattern
- Browser Cache TTL: กำหนด Cache บน Browser
- Purge Cache: ล้าง Cache ได้ทุกเมื่อ
Security Feature ของ Cloudflare
Cloudflare มี Security Feature หลากหลาย ตั้งแต่ DDoS Protection อัตโนมัติ WAF (Web Application Firewall) ป้องกัน SQL Injection, XSS, Bot Management และ Rate Limiting Free Plan มี WAF Managed Rules บางส่วนฟรี
Cloudflare provides various security features: automatic DDoS protection, WAF protecting against SQL injection and XSS, bot management, and rate limiting. The Free plan includes some WAF managed rules at no cost.
- DDoS L3/L4: ฟรีทุก Plan ไม่จำกัด
- WAF Managed Rules: บาง Rule ฟรีใน Free Plan
- Bot Fight Mode: ป้องกัน Bot อัตโนมัติ
- Rate Limiting: จำกัด Request ต่อ IP
- Firewall Rules: กำหนด Rule เองได้ (5 Rules ฟรี)
ประสิทธิภาพที่ได้จาก Cloudflare
นอกจาก CDN แล้ว Cloudflare มี Performance Feature เพิ่มเติมเช่น Minify HTML/CSS/JS อัตโนมัติ, Brotli Compression, HTTP/2 และ HTTP/3, Early Hints และ Rocket Loader (โหลด JS Async)
Beyond CDN, Cloudflare offers additional performance features: automatic HTML/CSS/JS minification, Brotli compression, HTTP/2 and HTTP/3, Early Hints, and Rocket Loader (async JS loading).
- Minify: CSS/JS/HTML อัตโนมัติ
- Brotli Compression: เล็กกว่า Gzip 15-25%
- HTTP/2 + HTTP/3/QUIC: Multiplexing
- Early Hints 103: เร็วขึ้น 30%+ บางกรณี
- Rocket Loader: JS Async (ระวัง Conflict)
วิธีตั้งค่า Cloudflare เบื้องต้น
1. สมัคร Cloudflare.com 2. เพิ่มเว็บไซต์และเลือก Free Plan 3. Cloudflare Scan DNS Record อัตโนมัติ 4. เปลี่ยน Nameserver ที่ Registrar ไปใช้ Cloudflare 5. รอ 24 ชั่วโมงให้ Propagate 6. เปิด SSL/TLS Mode เป็น Full (Strict) 7. เปิด Features ที่ต้องการ
Steps: 1. Sign up at Cloudflare.com 2. Add your site on Free plan 3. Cloudflare auto-scans DNS records 4. Change nameservers at your registrar to Cloudflare 5. Wait up to 24 hours for propagation 6. Set SSL/TLS mode to Full (Strict) 7. Enable desired features.
- Step 1: สมัคร Cloudflare.com ฟรี
- Step 2: Add Site → เลือก Free Plan
- Step 3: Verify DNS Records ที่ Scan มา
- Step 4: เปลี่ยน Nameserver ที่ Registrar (Domain)
- Step 5: รอ Propagate + ตรวจสอบว่า Active
Cloudflare Pro และ Business Plan
Free Plan เพียงพอสำหรับเว็บส่วนใหญ่ Pro ($20/เดือน) เพิ่ม WAF Advanced, Image Optimization, Browser Insights, 20 Page Rules Business ($200/เดือน) เพิ่ม Custom WAF Rules, Cache Analytics, PCI Compliance
Free plan suits most websites. Pro ($20/mo) adds Advanced WAF, Image Optimization, Browser Insights, and 20 Page Rules. Business ($200/mo) adds Custom WAF Rules, Cache Analytics, and PCI Compliance.
- Free: CDN + DDoS + SSL + 5 Firewall Rules
- Pro $20/เดือน: WAF Advanced + Image Opt
- Business $200/เดือน: Custom WAF + PCI
- Enterprise: Custom Price + SLA + Support Priority
- ส่วนใหญ่ใช้ Free ก็เพียงพอ