Static Site Hosting คืออะไร
Static site hosting explained — what it is and who should use it
สารบัญ
Static Site คืออะไร
Static site คือเว็บที่ไฟล์ HTML/CSS/JS ถูก generate ล่วงหน้า ไม่ประมวลผลฝั่งเซิร์ฟเวอร์ทุกครั้งที่มีผู้เข้าชม ตรงข้ามกับ WordPress หรือ PHP dynamic
A static site has HTML/CSS/JS files generated in advance with no server-side processing on each visit, unlike WordPress or PHP dynamic sites.
- ไม่มี database request ทุก pageview
- ไฟล์ HTML เสิร์ฟตรงจาก CDN
- เร็วมาก TTFB ต่ำ
- ปลอดภัยกว่าเพราะไม่มี server-side code
Static vs Dynamic Hosting ต่างกันอย่างไร
dynamic site ประมวลผล PHP/Node.js ทุกครั้ง static site ส่งไฟล์ที่ build ไว้แล้ว ทำให้ static เร็วกว่ามากและถูกกว่า
A dynamic site processes PHP/Node.js on every request; a static site delivers pre-built files, making it far faster and cheaper.
- dynamic: WordPress Joomla Laravel
- static: HTML บริสุทธิ์ Jekyll Hugo Next.js SSG
- static ไม่ต้องการ PHP MySQL
- static cache ได้ 100% บน CDN
Static Site เร็วกว่า Dynamic เท่าไหร่
Static site TTFB อยู่ที่ <50ms จาก CDN edge ส่วน dynamic WordPress มักอยู่ที่ 200-800ms แม้มี cache plugin ก็ยังช้ากว่า
Static site TTFB from a CDN edge is under 50 ms; a dynamic WordPress site is typically 200–800 ms even with a cache plugin.
- TTFB static จาก CDN: <50ms
- TTFB WordPress เฉลี่ย: 200-500ms
- Core Web Vitals สูงกว่าชัดเจน
- Lighthouse score ดีขึ้น 10-30 คะแนน
Static Site Generator ที่นิยม
Hugo Jekyll Next.js Astro Gatsby คือ framework ยอดนิยมสำหรับ static site แต่ละตัวมีจุดเด่นต่างกัน
Hugo, Jekyll, Next.js, Astro and Gatsby are popular static site frameworks, each with different strengths.
- Hugo: เร็วที่สุด build time
- Jekyll: นิยมใน GitHub Pages
- Next.js: React-based เหมาะเว็บซับซ้อน
- Astro: island architecture ใหม่ล่าสุด
แพลตฟอร์ม Static Site Hosting ยอดนิยม
Netlify Vercel GitHub Pages Cloudflare Pages เป็นแพลตฟอร์ม static hosting ชั้นนำ หลายเจ้ามี free tier ที่ดีมาก
Netlify, Vercel, GitHub Pages and Cloudflare Pages lead static hosting. Many offer excellent free tiers.
- Netlify: CI/CD forms analytics ใน free tier
- Vercel: เน้น Next.js ดีที่สุด
- GitHub Pages: ฟรีสำหรับ repo public
- Cloudflare Pages: CDN edge ทั่วโลกในตัว
เมื่อไหร่ไม่เหมาะกับ Static Site
ถ้าเว็บต้องการ user login ระบบ cart ข้อมูล real-time หรือ admin dashboard สำหรับ content editor ที่ไม่ใช่ developer จะยุ่งยากกว่า
If your site needs user login, a shopping cart, real-time data or an admin dashboard for non-developer content editors, static is more complicated.
- e-commerce ขนาดใหญ่: dynamic ดีกว่า
- membership site: ต้องการ server-side auth
- real-time data dashboard: ต้อง API backend
- blog ที่ทีม edit บ่อย: headless CMS ช่วยได้
ย้ายจาก WordPress ไป Static Site ได้ไหม
ได้ เครื่องมืออย่าง Simply Static หรือ HTTrack ช่วย export WordPress เป็น static HTML แต่ต้องละ feature dynamic เช่น comment หรือ search plugin
Yes. Tools like Simply Static or HTTrack can export WordPress to static HTML, but you must give up dynamic features like comments or live search.
- Simply Static plugin ส่งออก WordPress เป็น HTML
- ต้องมี solution ใหม่สำหรับ search/comment
- form: ใช้ Netlify Forms หรือ Formspree แทน
- ประหยัดค่าโฮสต์ได้มาก
สรุป: Static Site Hosting เหมาะกับใคร
Static hosting เหมาะที่สุดกับ portfolio landing page documentation blog และเว็บที่ content เปลี่ยนไม่บ่อย ได้ความเร็วสูงสุดและราคาถูกที่สุด
Static hosting is best for portfolios, landing pages, documentation and blogs with infrequently changing content — maximum speed at minimum cost.
- portfolio / landing page: เหมาะมาก
- documentation: Hugo/Docusaurus ดีที่สุด
- blog ผู้เขียนคนเดียว: Jekyll/Hugo
- SME website ที่ไม่ต้อง login: Astro/Next.js