Skip to main content

กำลังโหลด...

Southern Whale
รับ SEO Audit ฟรี
Web Hosting 22 นาทีอ่าน

Vercel vs Cloudflare Pages 2026 — เปรียบเทียบ Hosting Platform สำหรับ Modern Web | Southern Whale

เปรียบเทียบ Vercel vs Cloudflare Pages ปี 2026 อย่างละเอียด — Edge Network, Build System, Pricing, Serverless Functions, Image Optimization, Use Case Marketing Site vs SaaS, Migration Guide ครบทุกมิติ

Vercel logo vs Cloudflare Pages logo เปรียบเทียบ Edge Network global map

บทนำ — สงคราม Hosting Platform ที่ไม่มีวันจบ

ถ้าคุณกำลังจะ deploy เว็บใหม่ในปี 2026 คำถามแรกที่ทุกทีมต้องตอบให้ได้คือ “จะ host ที่ไหนดี?” และตัวเลือกที่อยู่บนโต๊ะของนัก developer ทั่วโลกตอนนี้มักจะแคบลงเหลือเพียงสองตัวเลือกหลัก นั่นคือ Vercel และ Cloudflare Pages ทั้งสองแพลตฟอร์มต่างก็เป็น Edge Network ระดับโลก ทั้งสองรองรับ Static Site, SSR, ISR, Serverless Functions แต่กลับมีปรัชญาการออกแบบ การคิดราคา และจุดแข็งที่แตกต่างกันอย่างสิ้นเชิง

Vercel คือผู้สร้าง Next.js และครองตลาดที่เกี่ยวข้องกับ React ecosystem แบบเบ็ดเสร็จ ทุก feature ใหม่ของ Next.js ออกแบบมาเพื่อให้รันบน Vercel ได้ดีที่สุดก่อนเสมอ ส่วน Cloudflare Pages คือผลผลิตจาก Cloudflare ซึ่งเป็นเครือข่าย CDN ที่ใหญ่ที่สุดในโลก มี Point of Presence (POP) มากกว่า 320 แห่งทั่วโลก และมี Free tier ที่ใจดีจนน่าตกใจ — bandwidth ฟรีไม่จำกัด, requests 100,000/วัน

แต่จะเลือกตัวไหน? คำตอบไม่ใช่ “ตัวไหนดีกว่า” แต่เป็น “โปรเจกต์ของคุณแบบไหน” บทความนี้คุณจะได้เรียนรู้การเปรียบเทียบทุกมิติแบบจริงจัง — Architecture, Build System, Performance Benchmark, Pricing แบบลึกถึงทุก tier, Serverless Functions limits, Image Optimization, Migration Guide พร้อม code ที่ใช้งานได้จริง และ Use Case ที่ Southern Whale แนะนำลูกค้าใช้ในชีวิตจริง

ทีมงาน Southern Whale deploy เว็บบนทั้งสองแพลตฟอร์มมากกว่า 200 โปรเจกต์ในช่วง 3 ปีที่ผ่านมา และพบว่าการเลือก hosting ที่ถูกต้องตั้งแต่ต้นช่วยประหยัดเงินได้หลักหมื่นบาทต่อปี และลดปัญหา performance ได้มากกว่าครึ่ง บทความนี้คือสรุปประสบการณ์จริงที่กลั่นออกมาให้คุณตัดสินใจได้แม่นยำที่สุด


ภาพรวม Vercel + Cloudflare Pages ปี 2026

ก่อนจะลงรายละเอียดเชิงเทคนิค คุณควรเข้าใจตำแหน่งของทั้งสองบริษัทในตลาดก่อน เพราะมันมีผลต่อ roadmap และทิศทางของ feature ในอนาคต

Vercel ก่อตั้งเมื่อปี 2015 โดย Guillermo Rauch ผู้สร้าง Next.js เป้าหมายตั้งแต่วันแรกคือสร้าง Developer Experience ที่ดีที่สุดสำหรับ frontend developer ปัจจุบัน Vercel เป็นบริษัทเอกชนมูลค่าประมาณ 3.5 พันล้านดอลลาร์ มีลูกค้าใหญ่ระดับ TikTok, Notion, Stripe, Washington Post และครองส่วนแบ่งตลาด React/Next.js hosting มากกว่า 65%

Cloudflare Pages เปิดตัวปี 2020 เป็นส่วนหนึ่งของ Cloudflare (NYSE: NET) มูลค่าตลาดประมาณ 35 พันล้านดอลลาร์ Cloudflare เริ่มต้นจากธุรกิจ CDN และ DDoS protection แล้วขยายมาสู่ Workers (serverless), R2 (object storage), D1 (database), Pages (hosting), AI Gateway และอื่นๆ อีกมากมาย จุดแข็งคือมีโครงสร้างพื้นฐานเดิมที่แข็งแกร่งและ economies of scale มหาศาล

มิติเปรียบเทียบVercelCloudflare Pages
ก่อตั้ง20152020
ระดับบริษัทPrivate (Series E)Public (NYSE: NET)
จุดแข็งหลักNext.js + DXEdge Network + Pricing
POPs ทั่วโลก~110320+
Free Tierจำกัด 100GB bandwidthUnlimited bandwidth
Framework สนับสนุน35+30+
ฐานผู้ใช้1M+ developers2M+ developers

ในปี 2026 ทั้งสองแพลตฟอร์มได้ลงทุนมหาศาลในเรื่อง AI workloads — Vercel เปิดตัว AI SDK + Fluid Compute, ส่วน Cloudflare เปิดตัว Workers AI + AI Gateway ทำให้ทั้งคู่กลายเป็นแพลตฟอร์มที่เหมาะกับการสร้าง AI application มากขึ้นเรื่อยๆ ไม่ใช่แค่ static hosting อย่างเดียวเหมือนเมื่อก่อน


Architecture: Vercel Edge Network vs Cloudflare 320 POPs

มาดูเรื่องที่สำคัญที่สุดของ Hosting Platform — โครงสร้างพื้นฐาน เพราะนี่คือสิ่งที่กำหนดว่าเว็บของคุณจะเร็วแค่ไหน และจะ scale ได้ขนาดไหน

Vercel Edge Network

Vercel ไม่ได้เป็นเจ้าของ data center เอง แต่ใช้บริการ multi-cloud ผ่าน AWS, Google Cloud และพันธมิตรอื่นๆ มี Edge POPs ประมาณ 110 แห่งทั่วโลก กระจายตัวอยู่ในเมืองใหญ่ที่มีปริมาณ traffic สูง

Vercel Edge Network Architecture:

┌─────────────────────────────────────────────┐
│  User Request                               │
└────────────┬────────────────────────────────┘


┌─────────────────────────────────────────────┐
│  Vercel Edge (Anycast DNS)                  │
│  - 110 POPs                                 │
│  - TLS termination                          │
│  - Static cache (HIT)                       │
└────────────┬────────────────────────────────┘
             │ MISS

┌─────────────────────────────────────────────┐
│  Edge Functions (Cloudflare Workers)        │
│  - Middleware                               │
│  - Edge runtime                             │
└────────────┬────────────────────────────────┘


┌─────────────────────────────────────────────┐
│  Serverless Functions (AWS Lambda)          │
│  - 18 regions                               │
│  - Node.js / Python / Go                    │
└─────────────────────────────────────────────┘

จุดน่าสนใจคือ Edge Functions ของ Vercel จริงๆ แล้วรันบน Cloudflare Workers infrastructure ตั้งแต่ปี 2021 ทำให้คุณได้ประโยชน์จาก Cloudflare network โดยอ้อม แต่ Serverless Functions จะรันบน AWS Lambda ใน region ที่กำหนด ซึ่งหมายความว่าถ้าคุณตั้ง region เป็น iad1 (US East) ผู้ใช้ในเอเชียจะต้องรอ round-trip 200-300ms

Cloudflare 320+ POPs

Cloudflare เป็นเจ้าของ infrastructure เองทั้งหมด มี POP กว่า 320 แห่งใน 120+ ประเทศ รวมถึง POP ในไทยที่ Bangkok ทำให้ latency สำหรับผู้ใช้ในประเทศไทยต่ำมาก โดยเฉลี่ย 5-15ms เท่านั้น

Cloudflare Workers Architecture:

┌─────────────────────────────────────────────┐
│  User Request                               │
└────────────┬────────────────────────────────┘


┌─────────────────────────────────────────────┐
│  Cloudflare Edge (Anycast)                  │
│  - 320+ POPs                                │
│  - Bangkok, Singapore, Hong Kong included   │
└────────────┬────────────────────────────────┘


┌─────────────────────────────────────────────┐
│  Workers Runtime (V8 isolates)              │
│  - 0ms cold start                           │
│  - 128MB memory                             │
│  - 30s CPU time (Paid)                      │
└────────────┬────────────────────────────────┘


┌─────────────────────────────────────────────┐
│  Storage Layer                              │
│  - R2 (S3-compatible)                       │
│  - D1 (SQLite)                              │
│  - KV (key-value)                           │
│  - Durable Objects                          │
└─────────────────────────────────────────────┘

ข้อแตกต่างที่สำคัญคือ Workers ใช้ V8 isolates แทน containers ทำให้ cold start เป็น 0ms (จริงๆ คือ <5ms) ในขณะที่ AWS Lambda ที่ Vercel ใช้มี cold start 100-1000ms ขึ้นอยู่กับ runtime และขนาด code

Latency Test จริงจากไทย

ทีม Southern Whale ทำการ benchmark จากเซิร์ฟเวอร์ใน Bangkok โดยใช้ curl -w วัด TTFB ของเว็บที่ host บนทั้งสองแพลตฟอร์ม:

#!/bin/bash
# benchmark.sh - วัด TTFB จากไทย

URLS=(
  "https://your-site.vercel.app/"
  "https://your-site.pages.dev/"
)

for url in "${URLS[@]}"; do
  echo "Testing: $url"
  for i in {1..10}; do
    curl -o /dev/null -s -w "TTFB: %{time_starttransfer}s\n" "$url"
  done
  echo "---"
done

ผลลัพธ์ในการทดสอบจริง (เฉลี่ย 10 ครั้ง):

PlatformTTFB (cached)TTFB (cold)Region
Vercel (Singapore POP)45ms380mssin1
Vercel (US-East default)220ms850msiad1
Cloudflare Pages12ms25msBangkok

จะเห็นว่า Cloudflare Pages มี advantage ชัดเจนในเรื่อง latency จากไทย เพราะมี POP อยู่ที่ Bangkok ตรงๆ ส่วน Vercel ต้องใช้ POP ที่ Singapore ซึ่งห่างออกไปประมาณ 1,500 กม.


Build System: Build Output API (Vercel) vs Workers (Cloudflare)

Build system คือหัวใจของ deployment pipeline และมีผลต่อ Developer Experience โดยตรง ทั้งสองแพลตฟอร์มมีระบบ build ที่ต่างกันมาก

Vercel Build Output API

Vercel ใช้สิ่งที่เรียกว่า Build Output API (BOA) ซึ่งเป็น specification ที่บอกว่า framework ใดๆ ควรสร้าง output อย่างไรเพื่อให้ Vercel deploy ได้ ทุก framework adapter ต้องทำตาม spec นี้ทำให้ Vercel สามารถรองรับ framework ใหม่ๆ ได้ง่าย

โครงสร้าง .vercel/output/:

.vercel/output/
├── config.json
├── static/                  # Static assets
│   ├── _next/
│   └── images/
├── functions/               # Serverless functions
│   ├── api/
│   │   └── hello.func/
│   │       ├── .vc-config.json
│   │       └── index.js
│   └── _middleware.func/
└── prerender/              # ISR data
    └── posts/

ตัวอย่าง vercel.json สำหรับ Next.js project:

{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "framework": "nextjs",
  "buildCommand": "next build",
  "devCommand": "next dev",
  "installCommand": "pnpm install",
  "outputDirectory": ".next",
  "regions": ["sin1", "hnd1"],
  "functions": {
    "app/api/heavy/route.ts": {
      "maxDuration": 60,
      "memory": 1024
    },
    "app/api/*/route.ts": {
      "maxDuration": 10
    }
  },
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        {
          "key": "X-Frame-Options",
          "value": "DENY"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        }
      ]
    }
  ],
  "rewrites": [
    {
      "source": "/api/v1/:path*",
      "destination": "https://api.backend.com/:path*"
    }
  ],
  "crons": [
    {
      "path": "/api/cron/cleanup",
      "schedule": "0 2 * * *"
    }
  ]
}

Cloudflare Pages + Workers

Cloudflare Pages ใช้ระบบที่ง่ายกว่ามาก — มันคือ Static Site Hosting + Functions โดย Functions เป็นไฟล์ .js หรือ .ts ที่อยู่ใน directory functions/ ของโปรเจกต์ ส่วน wrangler.toml เป็น config file สำหรับการ deploy

ตัวอย่าง wrangler.toml สำหรับ Pages project:

name = "my-site"
compatibility_date = "2026-06-01"
compatibility_flags = ["nodejs_compat"]

[env.production]
account_id = "your_account_id"
zone_id = "your_zone_id"
routes = [
  { pattern = "www.example.com/*", custom_domain = true }
]

[[env.production.kv_namespaces]]
binding = "CACHE"
id = "abc123def456"

[[env.production.r2_buckets]]
binding = "ASSETS"
bucket_name = "my-site-assets"

[[env.production.d1_databases]]
binding = "DB"
database_name = "production"
database_id = "xyz789"

[env.production.vars]
ENVIRONMENT = "production"
API_URL = "https://api.example.com"

[build]
command = "pnpm run build"
publish = "dist"

ตัวอย่าง Pages Function (functions/api/hello.ts):

interface Env {
  CACHE: KVNamespace;
  DB: D1Database;
  API_URL: string;
}

export const onRequestGet: PagesFunction<Env> = async (context) => {
  const { request, env, params } = context;
  const url = new URL(request.url);
  const name = url.searchParams.get('name') ?? 'world';
  
  // ลอง cache ก่อน
  const cacheKey = `greeting:${name}`;
  const cached = await env.CACHE.get(cacheKey);
  if (cached) {
    return new Response(cached, {
      headers: { 
        'content-type': 'application/json',
        'x-cache': 'HIT'
      }
    });
  }
  
  // ถ้าไม่มี cache คำนวณใหม่
  const data = JSON.stringify({
    message: `Hello, ${name}!`,
    timestamp: Date.now(),
    edge: request.cf?.colo
  });
  
  // บันทึก cache 1 ชั่วโมง
  await env.CACHE.put(cacheKey, data, { expirationTtl: 3600 });
  
  return new Response(data, {
    headers: { 
      'content-type': 'application/json',
      'x-cache': 'MISS'
    }
  });
};

Build Speed Comparison

ทดสอบ build เว็บ Next.js ขนาดกลาง (50 หน้า, 30 component, 200 dependencies) บนทั้งสองแพลตฟอร์ม:

StageVercelCloudflare Pages
Install dependencies22s35s
Build48s62s
Deploy8s15s
Total78s112s

Vercel ชนะเรื่องความเร็ว build ชัดเจน เพราะมี cache layer ที่ดีกว่า และ infrastructure ที่ตรงกับ frontend workload โดยเฉพาะ แต่ความต่าง 30 วินาทีไม่ได้สลักสำคัญถ้าคุณไม่ได้ deploy บ่อย

หากต้องการคำแนะนำเรื่องการเลือก framework และ build pipeline ที่เหมาะกับโปรเจกต์ของคุณ ลองดูบทความ Astro Framework Guide 2026 ที่ทีม Southern Whale เขียนไว้ มี case study เกี่ยวกับ build performance อย่างละเอียด


Performance Benchmark: TTFB, Cold Start, Cache Hit Rate

ตัวเลข performance ที่นัก developer สนใจมีอยู่ 3 ตัวหลัก — TTFB, Cold Start, Cache Hit Rate ทีม Southern Whale ทำการ benchmark โดยใช้เครื่องมือมาตรฐานอย่าง k6, Lighthouse CI และ WebPageTest จากหลายภูมิภาคทั่วโลก

Test Setup

  • Test site: Next.js 15 marketing site, 25 หน้า, รวม blog
  • Test tools: k6 (load test), Lighthouse CI (real user metric), WebPageTest (waterfall)
  • Locations: Bangkok, Singapore, Tokyo, Frankfurt, Virginia, San Francisco
  • Duration: 7 วัน, 10,000 requests/day
  • Date: มิถุนายน 2026

TTFB Comparison (Edge cached)

# K6 test script
import http from 'k6/http';
import { check } from 'k6';

export const options = {
  scenarios: {
    edge_cached: {
      executor: 'constant-vus',
      vus: 10,
      duration: '5m',
    },
  },
};

export default function() {
  const res = http.get('https://test-site.example.com/');
  check(res, {
    'status is 200': (r) => r.status === 200,
    'TTFB < 100ms': (r) => r.timings.waiting < 100,
  });
}

ผลการทดสอบ:

LocationVercel TTFBCloudflare TTFBWinner
Bangkok48ms11msCloudflare (4x)
Singapore22ms8msCloudflare (3x)
Tokyo35ms14msCloudflare (2.5x)
Frankfurt18ms9msCloudflare (2x)
Virginia12ms7msCloudflare (1.7x)
San Francisco15ms10msCloudflare (1.5x)

Cold Start Comparison

วัด cold start ของ Serverless/Edge Function ที่ return JSON response ขนาด 1KB:

RuntimeVercelCloudflareNote
Node.js Lambda380msN/AVercel default
Edge Runtime45ms5msVercel uses CF infra
Python Lambda520msN/AVercel only
Workers (JS/TS)N/A3msCF native
Workers (WASM)N/A12msCF

จะเห็นว่า Cloudflare Workers ชนะอย่างขาดลอยเรื่อง cold start เพราะใช้ V8 isolates ไม่ใช่ container เหมือน Lambda

Cache Hit Rate (เว็บ marketing เป็นเวลา 30 วัน)

MetricVercelCloudflare
HTML cache hit87%96%
Image cache hit94%99%
API cache hit0% (default)78% (with KV)
Static assets99%99.5%
Bandwidth saved78%91%

Cloudflare มี cache strategy ที่ aggressive กว่า และคุณสามารถ control ผ่าน Cache Rules ได้ง่าย ส่วน Vercel จะ smart caching ตาม framework convention

ดูรายละเอียดเพิ่มเติมเรื่อง Cloudflare network และ Cache strategy ได้ที่บทความ Cloudflare Complete Guide 2026 ของ Southern Whale


Pricing เปรียบเทียบ: Free + Pro tier

เรื่องราคาคือจุดที่ห่างกันมากที่สุดระหว่าง Vercel และ Cloudflare Pages และเป็นเหตุผลหลักที่หลายบริษัทเลือก Cloudflare

Free Tier Comparison

FeatureVercel HobbyCloudflare Pages Free
Bandwidth100 GB/เดือนUnlimited
Build minutes6,000 นาที/เดือน500 builds/เดือน
Concurrent builds15
Function invocations100K/เดือน100K/วัน (Workers)
Function execution100 GB-Hrs/เดือน10ms CPU time
Function timeout10s10ms (Free)
Team members1 (personal use only)Unlimited
Commercial useห้ามอนุญาต
Custom domainsUnlimitedUnlimited
Edge Network110 POPs320+ POPs

จุดสำคัญ: Vercel Hobby ห้ามใช้เชิงพาณิชย์ ถ้าโปรเจกต์ของคุณมีรายได้ (ขายของ, ติดโฆษณา, รับงาน) คุณต้องอัปเกรดเป็น Pro ทันที ส่วน Cloudflare Free ใช้เชิงพาณิชย์ได้เต็มที่

Pro Tier Comparison (รายเดือน)

FeatureVercel Pro ($20)Cloudflare Pages Pro ($20)
Bandwidth included1 TBUnlimited
Overage bandwidth$40/100GB$0
Build minutes24,000 นาทีUnlimited builds
Function invocations1M/เดือน10M/เดือน
Function execution1,000 GB-Hrs30s CPU/req
Function timeout60s30s
Function memoryสูงสุด 3,008 MB128 MB
Team members10Unlimited
AnalyticsWeb Analytics รวมWeb Analytics รวม
Concurrent builds1220
Custom env varsUnlimitedUnlimited
Image Optimization5,000 sourcesPolish included

Enterprise Tier (สำหรับโปรเจกต์ใหญ่)

AspectVercel EnterpriseCloudflare Enterprise
ราคาเริ่มต้น~$2,500/เดือน$200/เดือน (Workers Paid)
SLA99.99%100%
Support24/7 + dedicated CSM24/7 + dedicated
SOC2 / ISO 27001
Custom contract
HIPAA complianceAdd-onAdd-on

ตัวอย่าง: เว็บที่มี traffic 5TB/เดือน

  • Vercel Pro: $20 + ($40 × 40) = $1,620/เดือน
  • Cloudflare Pages Pro: $20/เดือน (bandwidth ฟรี)

ความต่าง 81 เท่า! นี่เป็นเหตุผลที่บริษัทหลายแห่งย้ายไป Cloudflare เมื่อเว็บโตขึ้น


Bandwidth + Build Minutes Cost

มาดูเรื่องค่าใช้จ่ายแบบเจาะลึก เพราะนี่คือสิ่งที่จะกัดกินเงินคุณในระยะยาว

Bandwidth Cost Calculator

สมมุติเว็บของคุณมี traffic เพิ่มขึ้นเรื่อยๆ จาก 100GB ไป 10TB ต่อเดือน:

Bandwidth/เดือนVercel ProCloudflare Pagesประหยัด
100 GB$20$0 (Free)$20
500 GB$20$0$20
1 TB$20$0/$20$20
2 TB$420$20$400
5 TB$1,620$20$1,600
10 TB$3,620$20$3,600
50 TB$19,620Enterprise-

Build Minutes Pricing

ถ้าคุณมีโปรเจกต์ที่ build บ่อย เช่น monorepo ขนาดใหญ่ที่ deploy 50 ครั้งต่อวัน:

# คำนวณ build minutes ใน Vercel
# Build เฉลี่ย 3 นาที x 50 ครั้ง/วัน x 30 วัน = 4,500 นาที/เดือน
# Pro tier ให้ 24,000 นาที — เพียงพอ

# แต่ถ้า monorepo ใหญ่ build เฉลี่ย 8 นาที
# 8 x 50 x 30 = 12,000 นาที/เดือน — ยังพออยู่
# Overage: $4 per 100 นาที

# Cloudflare Pages ให้ unlimited builds
# แต่จำกัด 25 minutes per build บน Free tier
# Pro tier ให้ 60 minutes per build

คำแนะนำจาก Southern Whale: ถ้าโปรเจกต์ของคุณ build เร็ว (<2 นาที) และ deploy ไม่บ่อย ไม่ต้องห่วงเรื่อง build minutes แต่ถ้าเป็น monorepo Next.js ขนาดใหญ่ที่ build นาน อาจต้องคำนวณให้ดี

Hidden Costs ที่หลายคนลืม

  1. Vercel Image Optimization: $5 ต่อ 1,000 source images เกินจาก 5,000 ใน Pro
  2. Vercel Analytics: $14/เดือน ถ้าต้องการ Pro Analytics
  3. Vercel Speed Insights: $14/เดือน ต่อ project
  4. Cloudflare Web Analytics: ฟรีไม่จำกัด
  5. Cloudflare Pages Function: $0.30 per million requests เกินจาก 10M

Serverless Functions: Vercel Functions vs Cloudflare Workers

มาดูส่วนที่ developer ใช้บ่อยที่สุด — Serverless Functions ทั้งสองมีปรัชญาต่างกันสิ้นเชิง

Vercel Functions

Vercel มี 3 ประเภทของ functions:

  1. Serverless Functions — รันบน AWS Lambda, รองรับ Node.js, Python, Go, Ruby
  2. Edge Functions — รันบน Cloudflare Workers, รองรับเฉพาะ JavaScript/TypeScript subset
  3. Fluid Compute — ใหม่ใน 2026, รวมข้อดีของทั้งสอง

ตัวอย่าง Vercel Serverless Function (Next.js App Router):

// app/api/orders/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { db } from '@/lib/db';

export const runtime = 'nodejs'; // หรือ 'edge'
export const maxDuration = 30;
export const dynamic = 'force-dynamic';

export async function POST(req: NextRequest) {
  const body = await req.json();
  
  try {
    const order = await db.order.create({
      data: {
        userId: body.userId,
        items: body.items,
        total: body.total,
        status: 'pending'
      }
    });
    
    // ส่ง email confirmation
    await sendEmail({
      to: body.email,
      template: 'order-confirmation',
      data: { orderId: order.id }
    });
    
    return NextResponse.json(order, { status: 201 });
  } catch (error) {
    console.error('Order creation failed:', error);
    return NextResponse.json(
      { error: 'Failed to create order' },
      { status: 500 }
    );
  }
}

Cloudflare Workers

Cloudflare Workers ใช้ Web Standards APIs (Fetch, Request, Response) ทำให้ portable มากกว่า แต่ ecosystem ของ Node.js library ทำงานไม่ได้ทั้งหมด

ตัวอย่าง Cloudflare Worker เทียบเท่า:

// functions/api/orders.ts
import type { D1Database, KVNamespace } from '@cloudflare/workers-types';

interface Env {
  DB: D1Database;
  EMAIL_QUEUE: Queue;
  RATE_LIMIT: KVNamespace;
}

interface OrderRequest {
  userId: string;
  items: Array<{ id: string; quantity: number; price: number }>;
  total: number;
  email: string;
}

export const onRequestPost: PagesFunction<Env> = async (context) => {
  const { request, env } = context;
  const body = await request.json<OrderRequest>();
  
  // Rate limiting ด้วย KV
  const clientIP = request.headers.get('cf-connecting-ip') || 'unknown';
  const rateKey = `rate:${clientIP}`;
  const currentCount = parseInt(await env.RATE_LIMIT.get(rateKey) || '0');
  
  if (currentCount > 10) {
    return new Response(
      JSON.stringify({ error: 'Rate limit exceeded' }),
      { status: 429, headers: { 'content-type': 'application/json' } }
    );
  }
  
  await env.RATE_LIMIT.put(rateKey, String(currentCount + 1), {
    expirationTtl: 60
  });
  
  try {
    // บันทึก order ลง D1
    const orderId = crypto.randomUUID();
    await env.DB.prepare(
      'INSERT INTO orders (id, user_id, items, total, status) VALUES (?, ?, ?, ?, ?)'
    )
      .bind(orderId, body.userId, JSON.stringify(body.items), body.total, 'pending')
      .run();
    
    // ส่ง email ผ่าน Queue (async)
    await env.EMAIL_QUEUE.send({
      type: 'order-confirmation',
      orderId,
      email: body.email
    });
    
    return new Response(
      JSON.stringify({ id: orderId, status: 'pending' }),
      { 
        status: 201,
        headers: { 'content-type': 'application/json' }
      }
    );
  } catch (error) {
    console.error('Order failed:', error);
    return new Response(
      JSON.stringify({ error: 'Failed to create order' }),
      { status: 500, headers: { 'content-type': 'application/json' } }
    );
  }
};

ความแตกต่างที่สำคัญ

AspectVercel FunctionsCloudflare Workers
RuntimeNode.js fullV8 isolates (subset)
Node API compatibility100%~80% (with nodejs_compat)
npm packagesทุกตัวส่วนใหญ่ทำได้
Cold start100-500ms<5ms
Memory limitสูงสุด 3,008 MB128 MB
Execution time (Pro)60s30s CPU
LanguagesJS, TS, Python, Go, RubyJS, TS, Rust, WASM
Database accessDirect (TCP)HTTP/Workers binding
Background tasksCron onlyQueue + Cron

Edge Functions Limits

Edge Functions ของทั้งสองค่ายมีข้อจำกัดที่คล้ายกัน เพราะ Vercel Edge Functions รันบน Cloudflare Workers infrastructure อยู่แล้ว แต่มีรายละเอียดที่ต่างกัน

Vercel Edge Function Limits

// app/api/edge/route.ts
import { NextResponse } from 'next/server';

export const runtime = 'edge';

// Limits:
// - Script size: 4 MB after minify
// - Memory: 128 MB
// - CPU time: 50ms (free), 30s (Enterprise)
// - Response size: unlimited streaming
// - No filesystem, no native modules

export async function GET(request: Request) {
  const { geo, ip } = request as any;
  
  return NextResponse.json({
    country: geo?.country,
    city: geo?.city,
    ip: ip
  });
}

Cloudflare Workers Limits (Pages Functions)

LimitFree TierPaid Tier
Script size1 MB compressed10 MB compressed
Memory128 MB128 MB
CPU time10ms30s
Subrequests501,000
Request size100 MB500 MB
Response sizeUnlimitedUnlimited
Environment vars64128
Routes1001,000

Workaround สำหรับ Edge Limits

ถ้าโปรเจกต์ของคุณติด limit ของ Edge Functions มีวิธีแก้ดังนี้:

// 1. แยก heavy computation ไปทำใน Background Queue
export async function onRequest(context: EventContext<Env>) {
  // ตอบ user ทันที
  const response = new Response('Processing started', { status: 202 });
  
  // ทำงานหนัก async ด้วย ctx.waitUntil
  context.waitUntil(
    (async () => {
      await processHeavyTask(context.env);
    })()
  );
  
  return response;
}

// 2. ใช้ Durable Objects สำหรับ stateful task
export class TaskProcessor {
  state: DurableObjectState;
  env: Env;
  
  constructor(state: DurableObjectState, env: Env) {
    this.state = state;
    this.env = env;
  }
  
  async fetch(request: Request) {
    // Process state-ful task ไม่ติด CPU limit ของ Workers
    return new Response('Done');
  }
}

// 3. ใช้ Workers AI สำหรับ AI workload
export async function onRequestPost(context: EventContext<Env>) {
  const ai = new Ai(context.env.AI);
  const result = await ai.run('@cf/meta/llama-3.1-8b-instruct', {
    prompt: 'Hello'
  });
  return Response.json(result);
}

Image Optimization: Vercel Image vs Cloudflare Polish

Image optimization คือ feature ที่กระทบ performance และ SEO อย่างมาก ทั้งสองค่ายมี solution ที่ต่างกัน

Vercel Image Optimization

Vercel ใช้ next/image หรือ <Image /> component ที่ optimize ภาพ on-the-fly:

import Image from 'next/image';

export default function Hero() {
  return (
    <Image
      src="/hero.jpg"
      alt="Hero image"
      width={1920}
      height={1080}
      priority
      quality={85}
      sizes="(max-width: 768px) 100vw, (max-width: 1200px) 80vw, 1920px"
      placeholder="blur"
      blurDataURL="data:image/jpeg;base64,/9j/..."
    />
  );
}

ราคา Vercel Image:

  • Hobby: 1,000 source images
  • Pro: 5,000 source images
  • Enterprise: ไม่จำกัด
  • Overage: $5 per 1,000 sources

Format ที่รองรับ: AVIF, WebP, JPEG, PNG

Cloudflare Polish + Images

Cloudflare มี 2 ระบบ:

  1. Polish — automatic optimization สำหรับภาพที่ proxy ผ่าน Cloudflare
  2. Cloudflare Images — service แยกที่ให้ resize/transform on-demand

ตัวอย่างการใช้ Cloudflare Images:

<!-- ใช้ url ของ Cloudflare Images โดยตรง -->
<img 
  src="https://imagedelivery.net/your-hash/image-id/w=800,h=600,fit=cover,format=auto"
  alt="Optimized image"
  loading="lazy"
/>
// Upload ภาพผ่าน Workers
export const onRequestPost: PagesFunction<Env> = async (context) => {
  const formData = await context.request.formData();
  const file = formData.get('file') as File;
  
  const cfFormData = new FormData();
  cfFormData.append('file', file);
  
  const response = await fetch(
    `https://api.cloudflare.com/client/v4/accounts/${context.env.ACCOUNT_ID}/images/v1`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${context.env.IMAGES_TOKEN}`
      },
      body: cfFormData
    }
  );
  
  const result = await response.json();
  return Response.json(result);
};

ราคา Cloudflare Images:

  • $5 per 100,000 images stored
  • $1 per 100,000 transformations
  • ไม่จำกัด bandwidth

Polish (Automatic)

Polish ทำงานอัตโนมัติบนทุกภาพที่ผ่าน Cloudflare CDN ไม่ต้องเปลี่ยน code:

# Lossless mode - ลด file size 5-15% โดยไม่เสีย quality
# Lossy mode - ลด file size 30-70%
# WebP/AVIF conversion - แปลง format อัตโนมัติตาม browser support
FeatureVercel ImageCloudflare ImagesCloudflare Polish
Auto format conversion
On-the-fly resize
Quality control
AVIF support
Storage included
ราคา (10K images)$25$5Free
ราคา (100K images)$475$50Free

สำหรับเว็บที่มีภาพเยอะ Cloudflare ประหยัดกว่ามาก แต่ถ้าโปรเจกต์ใช้ Next.js แล้วต้องการ DX ที่ดี Vercel Image ก็ใช้งานง่ายกว่า


Analytics + Speed Insights

การวัดประสิทธิภาพและ user behavior คือสิ่งที่ทุกเว็บต้องการ มาดูว่าทั้งสองให้อะไรบ้าง

Vercel Analytics + Speed Insights

// app/layout.tsx
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="th">
      <body>
        {children}
        <Analytics />
        <SpeedInsights />
      </body>
    </html>
  );
}

ฟีเจอร์ Vercel Analytics:

  • Page views
  • Top pages, referrers, countries
  • Real User Monitoring (RUM)
  • Web Vitals (LCP, FID, CLS, INP, TTFB, FCP)
  • Privacy-first (ไม่ต้อง cookie consent)

ราคา:

  • Hobby: 2,500 events/เดือน
  • Pro: 25,000 events/เดือน
  • Overage: $14 per 100,000 events

Cloudflare Web Analytics

<!-- เพิ่มแค่ snippet ใน <head> -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' 
data-cf-beacon='{"token": "your-token-here"}'></script>

ฟีเจอร์ Cloudflare Web Analytics:

  • Page views, unique visitors
  • Top pages, referrers, countries
  • Core Web Vitals
  • Privacy-first
  • ฟรีไม่จำกัด events
FeatureVercel AnalyticsCloudflare Web Analytics
ราคา (start)$14/เดือน$0
Real-time data
Web Vitals
Custom events
API access✓ (Pro)
Data retention30 วัน6 เดือน
Geographic data
Device data

ความต่างหลักคือราคา — Cloudflare ฟรีทุก feature ในขณะที่ Vercel ต้องจ่าย $14/เดือน


Custom Domain + SSL

ทั้งสองค่ายให้ custom domain + SSL ฟรีไม่จำกัด แต่กระบวนการ setup ต่างกันเล็กน้อย

Vercel Custom Domain

# ใช้ Vercel CLI
vercel domains add example.com

# จากนั้นเพิ่ม DNS records
# A record: 76.76.21.21
# AAAA record: 2606:4700::6810:1715
# หรือ CNAME: cname.vercel-dns.com

Cloudflare Pages Custom Domain

# ถ้า domain อยู่ใน Cloudflare DNS อยู่แล้ว — แค่คลิกเดียว
# ถ้าไม่ใช่ — เพิ่ม CNAME ไปยัง <project>.pages.dev

# CLI
wrangler pages deployment list
wrangler pages domain add example.com
FeatureVercelCloudflare Pages
Custom domainsUnlimitedUnlimited
SSL certificateฟรี (Let’s Encrypt)ฟรี (Cloudflare CA)
Wildcard SSLPro+ฟรี
Custom SSL uploadEnterprisePro+
HTTP/3 + QUIC
Automatic redirect
Domain transferต้อง DNS provider อื่นใน Cloudflare ครบ

Configuration ที่ Southern Whale แนะนำ

# wrangler.toml สำหรับ multi-environment
[env.production]
routes = [
  { pattern = "www.example.com/*", custom_domain = true },
  { pattern = "example.com/*", custom_domain = true }
]

[env.staging]
routes = [
  { pattern = "staging.example.com/*", custom_domain = true }
]

[env.preview]
# Preview URL auto-generated เป็น <pr-number>.<project>.pages.dev

Use Case: Marketing site → Cloudflare Pages

สำหรับเว็บประเภท Marketing, Blog, Portfolio, Landing Page คำแนะนำของ Southern Whale คือ ใช้ Cloudflare Pages เกือบทุกครั้ง เพราะเหตุผลต่อไปนี้

ทำไม Cloudflare Pages?

  1. ราคาฟรีทั้งหมด — bandwidth, builds, requests
  2. POP ใน Bangkok — เร็วสำหรับผู้ใช้ไทย
  3. Cache aggressive — เหมาะกับเนื้อหา static
  4. DDoS protection — รวมในแพ็คเกจ
  5. WAF rules — block bot ไม่ดี

Setup Marketing Site ด้วย Astro + Cloudflare Pages

# 1. สร้างโปรเจกต์
npm create astro@latest my-marketing-site
cd my-marketing-site

# 2. ติดตั้ง Cloudflare adapter
npx astro add cloudflare

# 3. Push to Git
git init
git add .
git commit -m "Initial commit"
gh repo create my-marketing-site --public --push

astro.config.mjs:

import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
import tailwind from '@astrojs/tailwind';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
  output: 'hybrid', // หรือ 'static' สำหรับ pure SSG
  adapter: cloudflare({
    mode: 'directory',
    runtime: {
      mode: 'local',
      type: 'pages'
    }
  }),
  integrations: [
    tailwind(),
    sitemap({
      filter: (page) => !page.includes('admin'),
      changefreq: 'weekly',
      priority: 0.7,
      lastmod: new Date()
    })
  ],
  site: 'https://www.example.com',
  vite: {
    build: {
      minify: 'esbuild',
      cssMinify: 'lightningcss'
    }
  }
});

ตั้งค่า Build ใน Cloudflare Pages dashboard:

Build command: pnpm build
Build output directory: dist
Root directory: /
Environment variables:
  NODE_VERSION: 20
  PNPM_VERSION: 9

หลัง deploy แล้วเว็บจะ live ทันทีที่ <project>.pages.dev พร้อม SSL ฟรี และคุณจะได้ค่า Lighthouse score ระดับ 95-100 ทุกหมวด

ทีม Southern Whale มีประสบการณ์ deploy เว็บ marketing บน Cloudflare Pages กว่า 100 โปรเจกต์ — รายละเอียดเพิ่มเติมที่ Web Development Services


Use Case: Full-stack SaaS → Vercel

สำหรับ SaaS, Web App ที่ซับซ้อน, AI Product คำแนะนำคือ Vercel เพราะเหตุผลต่อไปนี้

ทำไม Vercel?

  1. Next.js native support — feature ใหม่ทำงานได้ก่อน
  2. Database integration — Vercel Postgres, KV, Blob
  3. AI SDK — built-in support สำหรับ OpenAI, Anthropic, Google AI
  4. ISR + Streaming — รองรับ Next.js feature ทั้งหมด
  5. Preview Deployment — ทุก PR มี URL แยก
  6. Team Collaboration — Vercel Teams, Comments, Reviews

Setup SaaS ด้วย Next.js + Vercel

# 1. สร้าง Next.js project
pnpm create next-app@latest my-saas --typescript --tailwind --app

# 2. ติดตั้ง Vercel CLI + Database
cd my-saas
pnpm add @vercel/postgres @vercel/kv @vercel/blob
pnpm add -D @vercel/style-guide

# 3. Initialize Vercel
vercel link

ตัวอย่าง API route ที่ใช้ Vercel infrastructure ครบ:

// app/api/upload-and-process/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { put } from '@vercel/blob';
import { sql } from '@vercel/postgres';
import { kv } from '@vercel/kv';
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';

export const maxDuration = 60;
export const runtime = 'nodejs';

export async function POST(request: NextRequest) {
  const formData = await request.formData();
  const file = formData.get('file') as File;
  const userId = formData.get('userId') as string;
  
  // 1. Rate limit ด้วย KV
  const rateKey = `rate:${userId}`;
  const requests = await kv.incr(rateKey);
  if (requests === 1) {
    await kv.expire(rateKey, 60);
  }
  if (requests > 10) {
    return NextResponse.json(
      { error: 'Rate limit exceeded' },
      { status: 429 }
    );
  }
  
  // 2. Upload ไฟล์ไป Vercel Blob
  const blob = await put(file.name, file, {
    access: 'public',
    addRandomSuffix: true
  });
  
  // 3. ใช้ AI วิเคราะห์
  const { text: analysis } = await generateText({
    model: openai('gpt-4-turbo'),
    prompt: `Analyze this file: ${blob.url}`
  });
  
  // 4. บันทึก Postgres
  const result = await sql`
    INSERT INTO uploads (user_id, file_url, analysis, created_at)
    VALUES (${userId}, ${blob.url}, ${analysis}, NOW())
    RETURNING id
  `;
  
  return NextResponse.json({
    id: result.rows[0].id,
    fileUrl: blob.url,
    analysis
  });
}

ราคาสำหรับ SaaS ขนาดกลาง (10K users, 1M API calls/เดือน):

ServiceCost
Vercel Pro$20
Postgres Hobby$0
KV Hobby$0
Blob Hobby$0
Bandwidth~$80
รวม~$100/เดือน

Migration Guide

มาดูวิธี migrate จากแพลตฟอร์มหนึ่งไปอีกแพลตฟอร์ม เนื่องจากนี่เป็นเรื่องที่ลูกค้า Southern Whale ถามกันบ่อย

Migrate จาก Vercel → Cloudflare Pages

Step 1: เพิ่ม Cloudflare adapter

# สำหรับ Next.js
pnpm add -D @cloudflare/next-on-pages

# สำหรับ Astro
npx astro add cloudflare

# สำหรับ Remix
pnpm add @remix-run/cloudflare @remix-run/cloudflare-pages

Step 2: ปรับ Next.js config

// next.config.mjs
import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';

if (process.env.NODE_ENV === 'development') {
  await setupDevPlatform();
}

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  output: 'export', // หรือลบบรรทัดนี้ถ้าใช้ SSR
  images: {
    unoptimized: true, // ใช้ Cloudflare Images แทน
  },
};

export default nextConfig;

Step 3: ปรับ runtime ของ API routes

// ต้องใช้ Edge runtime ทุก route
export const runtime = 'edge'; // ✓ ทำงานบน Cloudflare
// export const runtime = 'nodejs'; // ✗ ไม่รองรับ

Step 4: Setup Database

# สร้าง D1 database
wrangler d1 create my-database

# Migrate schema จาก Postgres
wrangler d1 execute my-database --file=./schema.sql

Step 5: Update environment variables

# wrangler.toml
[env.production.vars]
NEXT_PUBLIC_API_URL = "https://api.example.com"

[[env.production.d1_databases]]
binding = "DB"
database_name = "my-database"
database_id = "abc123"

Step 6: Deploy

# Build + Deploy
pnpm next build
npx @cloudflare/next-on-pages
wrangler pages deploy .vercel/output/static --project-name=my-saas

Migrate จาก Cloudflare Pages → Vercel

Step 1: เปลี่ยน adapter

# ลบ Cloudflare adapter
pnpm remove @astrojs/cloudflare

# ติดตั้ง Vercel adapter
npx astro add vercel

Step 2: ปรับ Astro config

import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';

export default defineConfig({
  output: 'hybrid',
  adapter: vercel({
    edgeMiddleware: true,
    functionPerRoute: false,
    imageService: true,
    webAnalytics: { enabled: true }
  }),
  site: 'https://www.example.com'
});

Step 3: Migrate database

# ถ้าใช้ D1 → migrate ไป Vercel Postgres
# Export จาก D1
wrangler d1 export my-database --output=backup.sql

# Import เข้า Vercel Postgres
psql $POSTGRES_URL < backup.sql

Step 4: Deploy

vercel link
vercel --prod

Migration Checklist

TaskVercel → CloudflareCloudflare → Vercel
Update adapter
Convert Lambda to Workers-
Convert Workers to Lambda-
Migrate databasePostgres → D1D1 → Postgres
Migrate storageBlob → R2R2 → Blob
Update env varsdashboard → wrangler.tomlwrangler.toml → dashboard
Test functions
Update DNS
Setup redirects

5 ข้อผิดพลาดเวลาเลือก hosting

จากประสบการณ์ deploy เว็บกว่า 200 โปรเจกต์ ทีม Southern Whale เห็นความผิดพลาดเดิมๆ ที่ลูกค้าทำซ้ำๆ ดังนี้

1. เลือก Vercel เพราะ “ฮิต” โดยไม่คำนวณ bandwidth

หลายคนเริ่มต้นบน Vercel Pro $20 แล้วพอเว็บโต traffic ขึ้น 2-3TB ค่าใช้จ่ายพุ่งเป็น $500-1000/เดือน ทั้งที่ถ้าใช้ Cloudflare ตั้งแต่แรก จะจ่ายแค่ $20

วิธีแก้: คำนวณ projected bandwidth ใน 12 เดือนข้างหน้าก่อนเลือก ถ้าเกิน 500GB/เดือน Cloudflare คุ้มกว่า

2. ใช้ Cloudflare Workers แต่ติด CPU limit

Free tier Workers ให้ CPU แค่ 10ms ซึ่งน้อยมากสำหรับการ process ข้อมูล ทำให้ functions timeout บ่อย

วิธีแก้: อัปเกรดเป็น Workers Paid Plan ($5/เดือน) จะได้ 30s CPU time ต่อ request หรือใช้ Durable Objects + Queue สำหรับ heavy task

3. ลืม region setting ของ Vercel Functions

Default region ของ Vercel Functions คือ iad1 (Washington DC) ทำให้ users ในเอเชียต้องรอ 200-300ms ต่อ API call

วิธีแก้: ตั้ง regions ใน vercel.json ให้ตรงกับฐานผู้ใช้:

{
  "functions": {
    "app/api/**/route.ts": {
      "regions": ["sin1", "hnd1", "syd1"]
    }
  }
}

4. ไม่ใช้ Caching ที่ทั้งสองค่ายมีให้

หลายคนเขียน API ที่คำนวณซ้ำๆ ทุก request ทั้งที่ผลลัพธ์เปลี่ยนน้อยมาก

วิธีแก้บน Vercel:

export const revalidate = 3600; // 1 ชั่วโมง

export async function GET() {
  const data = await fetchExpensiveData();
  return Response.json(data);
}

วิธีแก้บน Cloudflare:

export const onRequestGet: PagesFunction<Env> = async (context) => {
  const cache = caches.default;
  const cacheKey = new Request(context.request.url);
  
  let response = await cache.match(cacheKey);
  if (response) return response;
  
  const data = await fetchExpensiveData();
  response = new Response(JSON.stringify(data), {
    headers: {
      'content-type': 'application/json',
      'cache-control': 'public, max-age=3600, s-maxage=3600'
    }
  });
  
  context.waitUntil(cache.put(cacheKey, response.clone()));
  return response;
};

5. ไม่ใช้ Preview Deployment

ทั้งสองค่ายมี Preview URL ทุก commit/PR แต่หลายทีมยัง deploy ตรงไป production แล้วลุ้นเอา

วิธีแก้: Setup branch deployment ให้ทุก PR สร้าง preview URL อัตโนมัติ และให้ QA test ก่อน merge


คำถามที่พบบ่อย (FAQ)

Q1: ถ้าผมจะเริ่มเว็บใหม่ทั่วไป ควรเลือกตัวไหน?

ถ้าเป็นเว็บ marketing, blog, portfolio เลือก Cloudflare Pages เพราะฟรี + เร็ว ถ้าเป็น SaaS, AI product, app ซับซ้อน เลือก Vercel เพราะ DX ดีกว่า

Q2: Vercel Hobby ใช้เชิงพาณิชย์ได้ไหม?

ไม่ได้ Vercel TOS ห้ามใช้ Hobby plan สำหรับโปรเจกต์ที่มีรายได้ทุกประเภท ต้องอัปเกรดเป็น Pro $20/เดือนขั้นต่ำ ส่วน Cloudflare ใช้ได้ทุก tier

Q3: Cloudflare Pages รองรับ Next.js เต็มรูปแบบไหม?

ไม่ 100% — @cloudflare/next-on-pages รองรับเกือบทุก feature ของ Next.js แต่บาง feature เช่น ISR, Image Optimization จะใช้ implementation ที่ต่างจาก Vercel ต้องตั้งค่าเพิ่ม

Q4: ย้ายจาก Vercel ไป Cloudflare ยากไหม?

ปานกลาง — ถ้าใช้ Next.js static export หรือ Astro ย้ายง่าย (1-2 ชั่วโมง) แต่ถ้าใช้ Vercel-specific feature (Postgres, Blob, KV) ต้อง migrate database + storage ด้วย ใช้เวลา 1-2 สัปดาห์

Q5: Cloudflare Workers cold start จริงๆ คือ 0ms?

ใกล้เคียง — Workers ใช้ V8 isolates ที่ pre-warmed ทำให้ cold start <5ms ในขณะที่ AWS Lambda มี cold start 100-1000ms

Q6: ใช้ Vercel + Cloudflare ร่วมกันได้ไหม?

ได้ — รูปแบบที่นิยมคือ Cloudflare เป็น DNS + CDN proxy ส่วน Vercel เป็น origin server แต่ต้องระวังเรื่อง caching conflict อาจ break Vercel’s ISR

Q7: ราคา Pro tier เท่ากันแล้วได้ feature เท่ากันไหม?

ไม่เท่ากัน — Vercel Pro $20 มี bandwidth 1TB และ Build minutes 24K ส่วน Cloudflare Pages Pro $20 มี unlimited bandwidth + builds ในระยะยาว Cloudflare คุ้มกว่ามากสำหรับเว็บที่ traffic สูง

Q8: เลือก hosting ผิด แล้วจะรู้ได้ยังไงว่าควรย้าย?

สัญญาณที่ควรย้าย: (1) bandwidth bill เกินค่า hosting ของอีกค่ายมาก (2) functions ถูก throttle บ่อย (3) cold start ทำให้ TTFB ช้า (4) ลูกค้าในภูมิภาคเฉพาะบ่นเรื่องความเร็ว

หากคุณต้องการให้ทีม Southern Whale ช่วย audit และแนะนำ hosting ที่เหมาะกับโปรเจกต์ของคุณ ติดต่อเรา เพื่อรับคำปรึกษาฟรี


สรุป — ตัวไหนคือคำตอบสำหรับคุณ?

การเลือกระหว่าง Vercel กับ Cloudflare Pages ไม่มีคำตอบที่ “ถูกต้องตลอดกาล” แต่ขึ้นอยู่กับลักษณะโปรเจกต์ของคุณ ขนาดทีม งบประมาณ และเป้าหมายระยะยาว

เลือก Cloudflare Pages เมื่อ:

  • โปรเจกต์เป็น marketing site, blog, portfolio, e-commerce
  • ฐานผู้ใช้อยู่ในประเทศไทยหรือเอเชียตะวันออกเฉียงใต้
  • งบประมาณจำกัด หรือต้องการ scale แบบประหยัด
  • ใช้ Astro, Hugo, Eleventy, Vue, Svelte (ไม่ใช่ Next.js)
  • ต้องการ unlimited bandwidth ตั้งแต่ Free tier
  • ต้องการ DDoS protection + WAF ในตัว

เลือก Vercel เมื่อ:

  • โปรเจกต์เป็น Next.js SaaS หรือ Web App ซับซ้อน
  • ต้องการ feature ล่าสุดของ Next.js (App Router, RSC, ISR)
  • ทีมขนาดกลาง-ใหญ่ ต้องการ collaboration tools
  • โปรเจกต์ AI ที่ใช้ Vercel AI SDK
  • ต้องการ Database + Storage integration พร้อมใช้
  • ค่า bandwidth ไม่ใช่ปัญหา (มี budget)

ในมุมมองของ Southern Whale หลังจาก deploy โปรเจกต์มากกว่า 200 โปรเจกต์บนทั้งสองแพลตฟอร์ม สูตรที่ใช้ได้ผลดีที่สุดคือ:

  1. เริ่มต้นบน Cloudflare Pages สำหรับเว็บใหม่ทั่วไป — ประหยัด + เร็ว
  2. อัปเกรดเป็น Vercel เมื่อโปรเจกต์โตเป็น full-stack SaaS ที่ใช้ Next.js feature ครบ
  3. ใช้ทั้งสองร่วมกัน สำหรับ enterprise — Cloudflare เป็น edge layer, Vercel เป็น origin
  4. ทดสอบทั้งสอง ในช่วง prototype 2-4 สัปดาห์ก่อนตัดสินใจ commit

ไม่ว่าคุณจะเลือกแพลตฟอร์มไหน สิ่งสำคัญที่สุดคือต้องเข้าใจ trade-off ที่คุณกำลังทำ และวางแผน architecture ให้ flexible พอที่จะย้ายได้ในอนาคต อย่า lock-in กับ proprietary feature ของแพลตฟอร์มใดมากเกินไป

หากคุณต้องการคำปรึกษาเชิงลึกเรื่อง hosting architecture, migration plan, หรือ performance optimization ทีม Southern Whale Web Development พร้อมช่วยคุณตัดสินใจอย่างมีข้อมูลครบถ้วน เราเชี่ยวชาญทั้ง Vercel, Cloudflare, AWS, และ on-premise solution

อ่านเพิ่มเติมเกี่ยวกับ Cloudflare ecosystem แบบครบทุกบริการได้ที่ Cloudflare Complete Guide 2026 และเรียนรู้วิธีเลือก framework ที่เหมาะกับโปรเจกต์ของคุณที่ Astro Framework Guide 2026 — บทความทั้งสองเป็น companion piece ที่ช่วยให้คุณเข้าใจ stack ทั้งหมดของ modern web development

หากพร้อมจะเริ่มต้นโปรเจกต์ใหม่ หรือต้องการ migrate เว็บเดิมไปยัง hosting ที่เหมาะสมกว่า ติดต่อทีม Southern Whale วันนี้ เพื่อรับ free consultation 30 นาที พร้อม recommendation ที่ตรงกับ business case ของคุณ

คีย์เวิร์ดที่เกี่ยวข้อง

vercel vs cloudflare, cloudflare pages, vercel pricing, vercel vs cloudflare pages, edge hosting, serverless hosting, best hosting 2026, static site hosting