Skip to main content
For high-traffic applications, you can deploy your frontend to a CDN and backend separately.

Architecture

Frontend: Served from CDN (CloudFlare, Vercel, Netlify) Backend: Runs on server (handles APIs only)

Benefits

  • Faster delivery: CDN edge locations worldwide
  • Lower backend load: Backend only handles APIs
  • Scalability: CDN handles millions of requests
  • Cost effective: CDN bandwidth cheaper than server

Setup

1. Build Frontend

2. Deploy Frontend to CDN

Vercel:
Netlify:
CloudFlare Pages:

3. Configure API URL

4. Deploy Backend

Deploy Mizu backend to server (DigitalOcean, AWS, etc.):

CORS Configuration

Backend must allow requests from CDN:

Environment Configuration

Development

Staging

Production

CDN Configuration

Vercel

Netlify

CloudFlare

Use CloudFlare Workers for API proxying.

Cache Headers

CDN respects your cache headers:

Deployment Workflow

Trade-offs

Pros

  • ✅ Very fast global delivery
  • ✅ Unlimited scalability
  • ✅ Lower backend costs
  • ✅ DDoS protection (CDN)

Cons

  • ❌ More complex setup
  • ❌ Two deployments
  • ❌ CORS configuration needed
  • ❌ Additional CDN costs

When to Use

Use CDN hosting when:
  • High traffic expected
  • Global audience
  • Cost optimization needed
  • Want best performance
Use embedded when:
  • Simple deployment preferred
  • Lower traffic
  • Single region
  • Want version consistency

Next Steps

Embedded FS

Alternative: single binary

Building

Build and optimization

CORS

CORS configuration