← Semua picks

Workflow Conditional

Migrasi Vercel ke Cloudflare Pages untuk SMB Indonesia

Saya migrate 3 project klien dari Vercel ke Cloudflare Pages 2025. Saving Rp 1-3 juta/bulan total. Verdict: worth untuk SMB scale. Detail tradeoff.

4 April 2026 · 9 menit ·Use case: Cost optimization untuk SaaS yang scale
Cloudflare PagesVercelAstroNext.js

TL;DR

  • Worth migrate kalau bill Vercel Anda > $20/bulan dan customer Anda mostly Indonesia.
  • Stay Vercel kalau Anda pakai ISR, Edge Middleware advanced, atau team familiar dengan Vercel ecosystem.
  • Saving typical untuk SMB Indonesia: 50-80% pada infra cost.

Konteks

3 project klien yang saya migrate Vercel → CF Pages 2025:

  1. Klinik dental SaaS (Astro): Bill Vercel $20 → CF Pages $0. Saving Rp 320rb/bulan.
  2. Fotograf billing SaaS (Next.js): Bill Vercel $40 → CF Pages $5 + Workers $5. Saving Rp 480rb/bulan.
  3. Marketing site SMB e-commerce (Astro): Bill Vercel $20 → CF Pages $0. Saving Rp 320rb/bulan.

Total saving across 3 project: ~Rp 1.1 juta/bulan = Rp 13 juta/tahun.

Why migrate

1. Cost

Vercel Hobby tier (free) limit:

  • 100GB bandwidth/bulan
  • Build time 100 jam/bulan
  • Serverless function 100GB-hours

Hit ini limit cepat untuk SMB yang grow. Forced upgrade ke Pro plan ($20/user/bulan).

CF Pages free tier:

  • Unlimited bandwidth
  • 500 build/bulan
  • 100K page request/hari (gratis)
  • $5/bulan untuk Workers + functions (jauh lebih murah dari Vercel function)

Untuk SMB Indonesia yang traffic 50-500K page view/bulan, CF free tier biasanya cukup.

2. Latency Indonesia

Vercel Edge: closest PoP untuk Indonesia adalah Singapore. Latency 80-120ms.

Cloudflare: 4 PoP di Indonesia (Jakarta, Surabaya, Medan, Denpasar). Latency 5-30ms.

Saya measure untuk salah satu klien Jakarta:

  • Vercel TTFB: 92ms median
  • CF Pages TTFB: 18ms median

5x improvement.

3. DDoS protection bawaan

Cloudflare network include DDoS protection di free tier. Vercel butuh Enterprise plan ($1000+/bulan) untuk equivalent.

Untuk SMB Indonesia, ini matter kalau ada threat (jarang, tapi pernah saya alami untuk klien yang viral).

Why stay Vercel

1. Next.js fitur advanced

Vercel adalah Next.js team. ISR, streaming, edge middleware advanced, On-demand revalidation — semua native di Vercel.

CF Pages support Next.js, tapi via @cloudflare/next-on-pages adapter. Some advanced features tidak work atau butuh workaround:

  • ISR: tidak supported (alternative: pakai CF cache headers manual)
  • revalidatePath / revalidateTag: tidak supported native
  • Edge middleware: support tapi different runtime
  • Image optimization built-in: support tapi pakai Cloudflare Images ($5/bulan)

2. Team workflow

Vercel ecosystem: Vercel Postgres, Vercel KV, Vercel Blob — semua integrate.

CF ecosystem: D1 (DB), KV, R2 (storage), Workers — semua integrate.

Kalau team Anda sudah deep di Vercel ecosystem, migration cost tinggi.

3. Preview deployments features

Vercel preview deploy punya:

  • Comment per PR (Vercel auto-add comment dengan deploy URL)
  • Speed Insights per branch
  • Analytics per deploy

CF Pages punya equivalent tapi less polished UX.

Migration step-by-step

Step 1: Audit Vercel bill

Login Vercel dashboard → Usage → review breakdown.

Common cost drivers untuk SMB Indonesia:

  • Bandwidth (100GB → upgrade)
  • Serverless function invocation
  • Edge function invocation

Note: kalau cost Anda dari product Vercel Postgres / KV / Blob, those need migrate separately.

Step 2: Profile current usage

Dari Vercel Analytics:

  • Page view/bulan
  • Function invocation/bulan
  • ISR cache hit rate
  • Top traffic country

Kalau >70% traffic dari Indonesia, CF migration confident.

Step 3: Test CF Pages compatibility

Untuk Astro: trivial, CF Pages native support. Untuk Next.js: install @cloudflare/next-on-pages, test build.

bun add -D @cloudflare/next-on-pages
bunx @cloudflare/next-on-pages

Cek output .vercel/output/static — pastikan tidak ada feature yang flag sebagai unsupported.

Step 4: Setup CF Pages

  • Create CF Pages project
  • Connect to GitHub repo
  • Build settings: framework preset Next.js (or Astro)
  • Environment variables: copy dari Vercel

Step 5: Test preview deploy

Push ke staging branch. Test:

  • Page render correct
  • API route work
  • Form submission work
  • Database connection work
  • Auth flow work
  • Performance lebih baik (atau at least not worse)

Step 6: DNS migration

Update DNS untuk domain Anda dari Vercel → Cloudflare.

Kalau domain di Cloudflare Registrar: trivial (1 click di CF Pages “Add custom domain”).

Kalau domain di Vercel atau registrar lain: update nameserver ke Cloudflare (24-48 jam propagation).

Step 7: Monitor

Setelah cutover, monitor 1-2 minggu:

  • Error rate (Sentry atau equivalent)
  • Performance metric
  • Customer feedback

Kalau ada issue, kembali ke Vercel sementara (DNS revert).

Step 8: Cancel Vercel

Setelah confident, cancel Vercel subscription. Save bill.

Specific gotchas

1. ISR replacement

Vercel ISR tidak tersedia di CF Pages. Alternatif:

Manual revalidation: pakai CF cache + manual invalidation via API.

// Trigger cache invalidation on data change
const purgeCache = async (urls: string[]) => {
  await fetch(`https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/purge_cache`, {
    method: 'POST',
    headers: { Authorization: `Bearer ${CF_API_TOKEN}` },
    body: JSON.stringify({ files: urls }),
  });
};

Less smooth dari Vercel ISR, tapi work.

2. Environment variable

Vercel env variable → bisa export via Vercel CLI. Import ke CF Pages dashboard.

3. Image optimization

Vercel automatic image optimization → tidak tersedia di CF Pages tanpa Cloudflare Images ($5/bulan).

Workaround:

  • Pakai Astro <Image> component (build-time optimization, work di CF Pages)
  • Atau pakai third-party (Cloudinary, ImageKit)

4. Edge function migration

Vercel Edge Function → CF Workers. Syntax similar tapi tidak 100% kompat.

Kalau Anda pakai Edge Middleware untuk auth atau rewrite, plan 2-4 jam untuk refactor.

Performance comparison

Sama project (Astro klinik dental SaaS, 50K page view/bulan):

MetricVercelCF Pages
TTFB (median Jakarta)92ms18ms
LCP (median Jakarta 4G)1.8s1.2s
Build time78s65s
Cold deploy time90s70s
Cost/bulan$20$0

CF menang di semua metric untuk traffic Indonesia. Vercel masih winner untuk US traffic (latency comparable, ecosystem advantage).

Yang surprising

Migration lebih mudah dari yang saya ekspektasikan. Untuk Astro project: 30-60 menit total. Untuk Next.js project: 2-4 jam (karena harus test next-on-pages adapter).

Customer tidak notice migration kalau dilakukan dengan baik. Tidak ada downtime, tidak ada user-facing change.

Konteks Indonesia

Untuk SMB Indonesia 2026:

  • Customer mostly Indonesia (Jawa specifically)
  • Budget infra < $50/bulan
  • Tidak pakai Next.js advanced features

CF Pages adalah Recommended migration target.

Untuk SMB yang grow ke regional/global:

  • Mungkin masuk akal stay Vercel (US/EU latency comparable)
  • Atau pakai both: Vercel untuk app, Cloudflare untuk static asset/CDN

Verdict

Conditional Recommend migration Vercel → CF Pages kalau:

  • Bill Vercel > $20/bulan
  • Customer Anda mostly Indonesia
  • Anda tidak deep di Vercel ecosystem (Postgres, KV, dll)
  • Stack Anda: Astro, Vite, atau Next.js tanpa ISR

Stay Vercel kalau:

  • Bill kecil ($0 free tier) dan tidak grow
  • Heavy Next.js feature usage (ISR, edge middleware advanced)
  • Team familiar + onboarded di Vercel
  • Customer international (US/EU specifically)

Untuk dev Tangerang yang cari tempat kerja: ulasan co-working space di Tangerang.

Ditulis oleh Asti Larasati

// Pick Workflow lain


← Semua picks RSS feed