deploy-router
Deploy Router - Vercel vs Cloudflare vs GitHub Pages Decision Engine
I intelligently route your deployment to the optimal platform based on project analysis, including repository visibility (private vs public).
When to Use This Skill
Ask me when you need help with:
- Platform Decision: "Should I deploy to Vercel or Cloudflare?"
- Project Analysis: "Analyze my project for deployment"
- SEO-Aware Routing: "I need dynamic SEO for my Next.js app"
- Cost Optimization: "What's the cheapest deployment option?"
- Edge-First: "I want global edge deployment"
- Private Repo Deployment: "Where can I deploy my private repo for free?"
π¨ CRITICAL: Repository Visibility Check (ALWAYS DO FIRST)
GitHub Pages has a major limitation: Free GitHub accounts can ONLY deploy GitHub Pages from public repositories. Private repo deployment requires GitHub Pro, Team, or Enterprise.
Priority Decision Based on Visibility
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 0: CHECK REPOSITORY VISIBILITY β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββ
β Is the repository PRIVATE? β
βββββββββββββββββββββββββββββββββ
β β
YES NO (Public)
β β
βΌ βΌ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β β GitHub Pages FREE β β β
All platforms available β
β β
Cloudflare Pages β β GitHub Pages is an option β
β β
Vercel β β for static public sites β
β β
Netlify β βββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββ
How to Detect Repository Visibility
# Check if git remote exists and get repo visibility
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
if [[ "$REMOTE_URL" =~ github.com[:/]([^/]+)/([^/.]+) ]]; then
OWNER="${BASH_REMATCH[1]}"
REPO="${BASH_REMATCH[2]}"
# Use GitHub CLI to check visibility
VISIBILITY=$(gh repo view "$OWNER/$REPO" --json visibility -q '.visibility' 2>/dev/null)
if [[ "$VISIBILITY" == "PRIVATE" ]]; then
echo "β οΈ PRIVATE REPOSITORY DETECTED"
echo " GitHub Pages requires GitHub Pro/Team/Enterprise for private repos"
echo " β Recommended: Cloudflare Pages (free for private repos)"
echo " β Alternative: Vercel (free tier available)"
else
echo "β
PUBLIC REPOSITORY - All deployment options available"
fi
fi
Platform Availability by Repo Visibility
| Platform | Private Repo (Free) | Public Repo (Free) | Notes |
|---|---|---|---|
| Cloudflare Pages | β Yes | β Yes | Best for private repos - No visibility restrictions |
| Vercel | β Yes | β Yes | Free tier works for both |
| Netlify | β Yes | β Yes | Free tier works for both |
| GitHub Pages | β No (requires Pro) | β Yes | BLOCKED for free private repos |
Decision Matrix
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PROJECT ANALYSIS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Does project require Node.js runtime features? β
β (Server Components with DB, fs, crypto, native modules) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
YES NO
β β
βΌ βΌ
βββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β VERCEL β β Static/Edge compatible? β
β (Node.js runtime) β β (No Node.js dependencies) β
βββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β
ββββββββββ΄βββββββββ
YES NO
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β CLOUDFLARE β β VERCEL β
β (Edge/Pages) β β (needs runtime) β
βββββββββββββββββββ βββββββββββββββββββ
Detailed Decision Tree
Step 1: Framework Detection
| Framework | Detection | Default Recommendation |
|---|---|---|
| Next.js | next.config.js/ts/mjs |
Depends on features used |
| Remix | remix.config.js |
Vercel (Node) or Cloudflare (adapter) |
| Astro | astro.config.mjs |
Cloudflare (static-first) |
| Nuxt | nuxt.config.ts |
Vercel (SSR) or Cloudflare (static) |
| SvelteKit | svelte.config.js |
Either (adapter-based) |
| Static (Vite/CRA) | vite.config.ts, no SSR |
Cloudflare Pages |
Step 2: Feature Analysis
Signals for VERCEL (Node.js Runtime):
- Server Components with database calls (
prisma,drizzle, direct SQL) -
fsmodule usage (file system operations) -
cryptoor native Node.js modules - Server Actions with complex backend logic
- Long-running API routes (> 30s execution)
- WebSocket connections (real-time features)
- Heavy image processing (Sharp, Jimp)
- PDF generation (Puppeteer, Playwright)
- Dynamic OG images with complex rendering
-
getServerSidePropswith database queries
Signals for CLOUDFLARE (Edge/Static):
- Static site generation (SSG)
- Simple API routes (< 30s, no Node.js deps)
- Edge-compatible database (Cloudflare D1, Turso, PlanetScale)
- KV storage for caching
- R2 for file storage
- Durable Objects for state
- Cost-sensitive deployment
- Global edge distribution priority
- Simple auth (JWT, sessions without DB)
Step 3: SEO Requirements (Vercel Wins for Dynamic SEO)
When SEO matters most, choose carefully:
| SEO Need | Vercel | Cloudflare | GitHub Pages |
|---|---|---|---|
| Static meta tags | β | β | β |
| Dynamic meta from DB | β (SSR) BEST | β οΈ (ISR/Edge only) | β (static only) |
| Per-page dynamic OG | β BEST | β οΈ (limited) | β |
| Real-time product data | β (SSR) BEST | β οΈ (stale cache) | β |
| Sitemap generation | β | β | β (manual) |
| robots.txt | β | β | β |
| Structured data (JSON-LD) | β (dynamic) | β (static) | β (static) |
| Core Web Vitals | β (optimized) | β (fast edge) | β (fast static) |
| SSR/ISR for freshness | β BEST | β οΈ (edge-limited) | β |
SEO Tier Recommendations
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SEO REQUIREMENTS ROUTING β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β TIER 1 - Critical SEO (choose VERCEL): β
β ββ E-commerce product pages (prices change, inventory) β
β ββ News/content sites (freshness matters for Google) β
β ββ SaaS landing pages with dynamic pricing β
β ββ Marketplace listings (real-time availability) β
β ββ Any page where DB-driven meta tags are required β
β β
β TIER 2 - Good SEO (CLOUDFLARE works): β
β ββ Blogs with static content β
β ββ Documentation sites β
β ββ Marketing pages (rarely changing) β
β ββ Portfolio sites β
β ββ ISR with revalidation (1-hour stale OK) β
β β
β TIER 3 - Basic SEO (any platform): β
β ββ Internal tools (SEO doesn't matter) β
β ββ Admin dashboards β
β ββ Private apps β
β ββ Prototypes/MVPs β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Why Vercel Wins for Dynamic SEO
- True SSR: Every request can fetch fresh data from database
- ISR with on-demand revalidation:
revalidateTag()andrevalidatePath() - Dynamic OG images:
@vercel/oggenerates images server-side - Edge + Node.js hybrid: Edge for speed, Node.js for data fetching
- Built-in image optimization: Automatic WebP/AVIF conversion
- Preview deployments: Test SEO before going live
When Cloudflare is SEO-Acceptable
- Static blogs: Meta tags baked at build time
- Documentation: Content rarely changes
- ISR with Workers: If 1-hour stale data is acceptable
- Hybrid approach: Cloudflare Pages + external API for dynamic data
Platform Comparison
Vercel
Best For:
- Next.js apps with full Node.js features
- Dynamic SEO (meta tags from database)
- Server Components with complex data fetching
- Image optimization (built-in)
- Preview deployments for PRs
- Teams needing easy DX
Pricing (2025):
- Hobby: Free (limited)
- Pro: $20/user/month
- Serverless Functions: 100GB-hours free, then $0.18/GB-hour
- Edge Functions: 500K free, then $0.65/million
Limitations:
- Serverless function timeout: 10s (Hobby), 60s (Pro), 300s (Enterprise)
- Edge function timeout: 30s
- Cold starts on low-traffic sites
Cloudflare
Best For:
- Static sites with edge caching
- Edge-first applications
- Cost-sensitive projects
- Simple API routes
- Global CDN distribution
- Cloudflare ecosystem (R2, D1, KV)
- π PRIVATE REPOS (works with free tier!)
Pricing (2025):
- Workers Free: 100K requests/day
- Workers Paid: $5/month + $0.50/million requests
- Pages: Unlimited sites, 500 builds/month free
- R2: 10GB free, then $0.015/GB
Limitations:
- No Node.js runtime (V8 isolates only)
- CPU time limit: 10ms (free), 30s (paid)
- Memory: 128MB
- No native modules (Sharp, Prisma binary, etc.)
Why Cloudflare for Private Repos:
- β No repository visibility restrictions
- β Connect private GitHub repos directly
- β Automatic deployments from private branches
- β Preview deployments for PRs
- β Free tier is generous
GitHub Pages
Best For:
- PUBLIC repositories only (free tier)
- Open-source documentation
- Public project sites
- Static Jekyll/Hugo/Astro sites
- When source code visibility is intentional
Pricing (2025):
- Free for public repos
- Requires GitHub Pro/Team/Enterprise for private repos ($4-21/user/month)
- 1GB storage limit
- 100GB bandwidth/month
Limitations:
- β NO PRIVATE REPO SUPPORT on free accounts
- No server-side rendering
- No API routes
- No dynamic content
- Build time limit: 10 minutes
- No environment variables at runtime
When to Use GitHub Pages:
β
DO use GitHub Pages when:
- Repository is PUBLIC
- Content is 100% static
- You want zero deployment config
- Open-source project docs
β DO NOT use GitHub Pages when:
- Repository is PRIVATE (use Cloudflare Pages instead!)
- You need SSR/dynamic content
- You need API routes
- You need environment variables
Analysis Workflow
When user asks "where should I deploy?", I follow this order:
0. Check Repository Visibility (FIRST!)
# CRITICAL: Check if repo is private BEFORE anything else
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
if [[ "$REMOTE_URL" =~ github.com[:/]([^/]+)/([^/.]+) ]]; then
OWNER="${BASH_REMATCH[1]}"
REPO="${BASH_REMATCH[2]}"
# Check visibility with GitHub CLI
VISIBILITY=$(gh repo view "$OWNER/$REPO" --json visibility -q '.visibility' 2>/dev/null)
if [[ "$VISIBILITY" == "PRIVATE" ]]; then
echo "π PRIVATE REPO - GitHub Pages NOT available on free tier"
echo " Recommended: Cloudflare Pages or Vercel"
GITHUB_PAGES_AVAILABLE=false
else
echo "β
PUBLIC REPO - All platforms available"
GITHUB_PAGES_AVAILABLE=true
fi
else
echo "β οΈ No GitHub remote detected - assuming private"
GITHUB_PAGES_AVAILABLE=false
fi
1. Scan Project Structure
# Framework detection
ls -la | grep -E "next.config|remix.config|astro.config|nuxt.config|svelte.config|vite.config"
# Package.json analysis
cat package.json | jq '.dependencies, .devDependencies'
# Check for SSR/SSG configuration
grep -r "getServerSideProps\|getStaticProps\|generateStaticParams" --include="*.tsx" --include="*.ts" | head -20
2. Detect Node.js Dependencies
# Native module detection
grep -E "prisma|sharp|puppeteer|playwright|canvas|bcrypt|argon2" package.json
# File system usage
grep -r "require\('fs'\)\|from 'fs'\|import fs" --include="*.ts" --include="*.tsx" --include="*.js" | head -10
# Crypto usage
grep -r "require\('crypto'\)\|from 'crypto'" --include="*.ts" --include="*.tsx" | head -10
3. Analyze SEO Requirements
# Dynamic meta detection
grep -r "generateMetadata\|Head.*title\|meta.*content" --include="*.tsx" --include="*.ts" | head -10
# Database calls in metadata
grep -rB5 "generateMetadata" --include="*.tsx" | grep -E "prisma|db\.|fetch\("
# Check for e-commerce/content patterns that need fresh SEO
grep -rE "product|price|inventory|article|news" --include="*.tsx" | head -10
4. Generate Recommendation
Based on analysis, I provide:
## π Deployment Recommendation
**Platform**: [VERCEL / CLOUDFLARE]
**Confidence**: [HIGH / MEDIUM / LOW]
### Analysis Results
| Factor | Finding | Impact |
|--------|---------|--------|
| Framework | Next.js 14 | Neutral |
| Node.js deps | Prisma, Sharp | β VERCEL |
| SEO needs | Dynamic meta | β VERCEL |
| Budget | Cost-sensitive | β Cloudflare |
| Scale | Global edge | β Cloudflare |
### Why [PLATFORM]
[Detailed reasoning based on findings]
### Configuration
[Platform-specific setup instructions]
### Alternative
If you need [opposite platform features], consider:
- [Migration path]
- [Hybrid approach]
Quick Decision Guide
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MASTER DECISION TREE (Check in order!) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β STEP 1: Is repo PRIVATE? β
β ββ YES β β Eliminate GitHub Pages β
β β β Go to Step 2 β
β ββ NO β GitHub Pages is an option (static only) β
β β
β STEP 2: Do you need dynamic SEO? β
β ββ YES β β
VERCEL (SSR, real-time meta, OG images) β
β ββ NO β Go to Step 3 β
β β
β STEP 3: Do you need Node.js runtime? β
β ββ YES β β
VERCEL (Prisma, Sharp, fs, crypto) β
β ββ NO β Go to Step 4 β
β β
β STEP 4: Is it a static site? β
β ββ YES, Private repo β β
CLOUDFLARE Pages β
β ββ YES, Public repo β β
CLOUDFLARE or GitHub Pages β
β ββ NO β Go to Step 5 β
β β
β STEP 5: Do you need edge performance + cost savings? β
β ββ YES β β
CLOUDFLARE (Workers/Pages) β
β ββ NO β β
VERCEL (default choice for Next.js) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PLATFORM QUICK REFERENCE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Use VERCEL when: β
β ββ Dynamic SEO is critical (e-commerce, news, marketplaces) β
β ββ Next.js with Server Components + DB β
β ββ Native Node.js modules (Sharp, Prisma, Puppeteer) β
β ββ Real-time OG image generation β
β ββ WebSockets/real-time features β
β ββ Team wants easiest DX β
β β
β Use CLOUDFLARE when: β
β ββ π PRIVATE REPO (GitHub Pages blocked on free tier!) β
β ββ Static site (Astro, Hugo, plain HTML) β
β ββ Edge-first, low latency priority β
β ββ Cost-sensitive (Cloudflare is cheaper) β
β ββ Simple API routes without Node.js deps β
β ββ Already using Cloudflare ecosystem (R2, D1, KV) β
β ββ Global CDN distribution priority β
β β
β Use GITHUB PAGES when: β
β ββ Repository is PUBLIC (required for free tier!) β
β ββ 100% static content (no SSR, no API) β
β ββ Open-source project documentation β
β ββ Zero deployment configuration needed β
β β
β HYBRID approach: β
β ββ Frontend on Cloudflare Pages (edge speed) β
β ββ API/backend on Vercel Functions (Node.js power) β
β ββ Best of both: edge speed + Node.js + full SEO β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Integration with DevOps Agent
After recommendation, I trigger the appropriate deployment:
// For Vercel deployment
Task({
subagent_type: "sw-infra:devops:devops",
prompt: `Deploy to Vercel:
- Project: ${projectName}
- Framework: ${framework}
- Environment: ${env}
Use existing VERCEL_TOKEN from .env`,
description: "Deploy to Vercel"
});
// For Cloudflare deployment
Task({
subagent_type: "sw-infra:devops:devops",
prompt: `Deploy to Cloudflare:
- Project: ${projectName}
- Type: ${isStatic ? 'Pages' : 'Workers'}
Use wrangler CLI (already authenticated)`,
description: "Deploy to Cloudflare"
});
Trigger Keywords
This skill activates for:
- deploy, deployment
- vercel vs cloudflare, cloudflare vs vercel
- where to deploy, where should I deploy
- vercel, cloudflare workers, cloudflare pages
- edge deployment, SSR deployment
- static site deployment, JAMstack deployment
- which hosting, best hosting for
- deployment recommendation, deployment decision
- github pages (β οΈ will check visibility first!)
- private repo deployment, private repository hosting
- SEO hosting, best SEO platform, dynamic SEO deployment
- e-commerce deployment, product page SEO
Examples
Example 1: Next.js with Prisma
User: "Where should I deploy my Next.js app with Prisma?"
Analysis:
- Framework: Next.js 14
- Database: Prisma (requires Node.js runtime)
- Impact: MUST use Node.js-compatible host
Recommendation: VERCEL
- Prisma requires Node.js runtime (binary execution)
- Cloudflare Workers don't support Prisma's native binary
- Vercel provides Node.js serverless functions
Alternative: Use Prisma Edge with Cloudflare D1 (requires migration)
Example 2: Astro Blog
User: "Best deployment for my Astro blog?"
Analysis:
- Framework: Astro (static-first)
- Database: None
- SEO: Static meta tags only
Recommendation: CLOUDFLARE PAGES
- 100% static site, no server runtime needed
- Free tier covers most blogs
- Global edge CDN included
- Faster than Vercel for static content
Example 3: Next.js E-commerce with Dynamic SEO
User: "I'm building an e-commerce site with product pages that need dynamic meta tags from the database"
Analysis:
- Framework: Next.js
- SEO: Dynamic meta from database (products, prices)
- Database: PostgreSQL with product catalog
Recommendation: VERCEL
- Dynamic `generateMetadata()` with DB calls
- Server-side rendering for SEO
- Product pages need fresh data for Google
- Cloudflare would require ISR which may show stale prices
Example 4: Private Repo Static Site (π IMPORTANT!)
User: "Where should I deploy my private Astro documentation site?"
Analysis:
- Framework: Astro (static-first)
- Repository: PRIVATE β οΈ
- SEO: Static meta tags only
- Content: Internal documentation
Step 0 - Visibility Check:
π PRIVATE REPO DETECTED
β GitHub Pages: NOT AVAILABLE (requires GitHub Pro/Team)
β
Cloudflare Pages: Available (free tier)
β
Vercel: Available (free tier)
Recommendation: CLOUDFLARE PAGES
- Private repo works with free tier
- Static site = perfect fit for edge deployment
- Fast global CDN
- 500 builds/month free
- No Node.js needed
Alternative: Vercel (also works, but Cloudflare is cheaper for static)
β οΈ DO NOT recommend GitHub Pages for private repos!
Example 5: High-SEO E-commerce (Vercel wins)
User: "I need the best SEO possible for my product catalog with 10,000+ products"
Analysis:
- Framework: Next.js 14 with App Router
- Products: 10,000+ items with prices, inventory, reviews
- SEO Requirements: CRITICAL
- Dynamic meta tags per product
- Real-time pricing in structured data
- Fresh inventory status for Google
- Dynamic OG images showing product photos
SEO Analysis Results:
| Requirement | Vercel | Cloudflare | GitHub Pages |
|-------------|--------|------------|--------------|
| Dynamic meta from DB | β
SSR | β οΈ ISR (stale) | β |
| Real-time prices | β
| β οΈ (1hr delay) | β |
| Dynamic OG images | β
@vercel/og | β οΈ Limited | β |
| Inventory freshness | β
SSR | β οΈ Cache | β |
Recommendation: VERCEL (STRONG)
- SSR ensures Google sees fresh data every crawl
- `generateMetadata()` with database calls
- `@vercel/og` for product OG images
- ISR with on-demand revalidation for cache-then-fresh
- Image optimization built-in
Why NOT Cloudflare:
- ISR cache means Google might see stale prices
- No native OG image generation
- Edge runtime can't run Prisma directly
Cost consideration:
- Vercel Pro ($20/month) vs Cloudflare (free)
- For critical SEO sites, Vercel Pro is worth it
Migration Paths
Vercel β Cloudflare
- Replace Prisma with Drizzle + D1/Turso
- Convert Server Components to Edge-compatible
- Use
@cloudflare/next-on-pagesadapter - Move file storage to R2
Cloudflare β Vercel
- Remove Cloudflare-specific bindings (KV, D1, R2)
- Replace with Vercel equivalents (Edge Config, Postgres, Blob)
- Update
wrangler.tomltovercel.json - Test Node.js compatibility
Enterprise Considerations
Scaling Beyond Free Tier
| Platform | Free Tier Limit | When to Upgrade | Enterprise Cost |
|---|---|---|---|
| Vercel | 100GB bandwidth, 100 serverless hours | > 50K requests/day | $20/user/month (Pro), Custom (Enterprise) |
| Cloudflare | 100K requests/day, 500 builds/month | > 100K requests/day | $5/month (Workers), Custom (Enterprise) |
| GitHub Pages | 100GB bandwidth, 10 min builds | N/A (static only) | Pro: $4/month, Team: $4/user |
Enterprise Features Comparison
| Feature | Vercel Enterprise | Cloudflare Enterprise | Notes |
|---|---|---|---|
| SLA | 99.99% | 100% (edge) | Cloudflare edge is bulletproof |
| DDoS Protection | β Included | β Industry-leading | Cloudflare is the gold standard |
| SSO/SAML | β Enterprise | β Enterprise | Both require enterprise tier |
| Audit Logs | β Enterprise | β Enterprise | Compliance requirements |
| Custom Domains | Unlimited | Unlimited | Both generous |
| Private Network | β Secure Compute | β Cloudflare Tunnel | Zero-trust networking |
| Compliance | SOC2, HIPAA | SOC2, HIPAA, PCI-DSS | Cloudflare has broader certs |
When Enterprise Tier is Needed
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ENTERPRISE TIER TRIGGERS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Vercel Enterprise ($$$): β
β ββ > 1M requests/month β
β ββ > 100 team members β
β ββ SOC2/HIPAA compliance required β
β ββ SLA guarantees needed for contracts β
β ββ Advanced observability (OpenTelemetry) β
β ββ Dedicated support β
β β
β Cloudflare Enterprise ($$$): β
β ββ > 10M requests/day β
β ββ Custom WAF rules β
β ββ Advanced bot management β
β ββ PCI-DSS compliance β
β ββ 24/7 phone support β
β ββ Custom SSL certificates β
β β
β Stay on Free/Pro when: β
β ββ < 50K requests/day β
β ββ < 20 team members β
β ββ No compliance requirements β
β ββ Community support is acceptable β
β ββ Standard SLA is fine β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Framework-Specific Guidance
Remix (Special Case)
Remix is uniquely positioned to work well on BOTH platforms:
| Remix Adapter | Platform | Best For |
|---|---|---|
@remix-run/cloudflare |
Cloudflare Workers | Edge-first, cost-sensitive |
@remix-run/cloudflare-pages |
Cloudflare Pages | Static + edge functions |
@remix-run/vercel |
Vercel | Node.js features, dynamic SEO |
@remix-run/node |
Vercel/Railway | Full Node.js, DB access |
Remix + Cloudflare Decision:
If your Remix app:
ββ Uses only edge-compatible packages β Cloudflare β
ββ Needs KV/D1/R2 storage β Cloudflare β
(native support)
ββ Is cost-sensitive β Cloudflare β
(cheaper)
ββ Needs Prisma/native modules β Vercel (Node.js required)
ββ Has critical dynamic SEO β Vercel (SSR power)
ββ Needs WebSockets β Vercel (Durable Objects are complex)
Remix Setup for Cloudflare:
npx create-remix@latest --template cloudflare-pages
Remix Setup for Vercel:
npx create-remix@latest --template vercel
Backend Services (Cron Jobs, Workers)
Not all deployments are frontends. For backend services:
| Use Case | Recommended Platform | Alternative |
|---|---|---|
| Cron < 1/hour | Vercel Cron, GitHub Actions | - |
| Cron >= 1/hour | Railway, Render, Fly.io | Cloudflare Workers (paid) |
| Long-running jobs | Railway, Render | Modal, Inngest |
| Event processing | Cloudflare Queues | AWS SQS, Inngest |
| Background tasks | Inngest, Trigger.dev | Railway |
Backend Platform Comparison
| Platform | Pricing | Best For | Limitations |
|---|---|---|---|
| Railway | $5/month + usage | Full-stack, databases, cron | Can get expensive at scale |
| Render | Free tier + $7/month | Background workers, cron | Cold starts on free |
| Fly.io | Free tier + usage | Global edge, persistent | Learning curve |
| Inngest | Free tier + usage | Event-driven workflows | Requires adapter |
| Cloudflare Workers | $5/month | Edge compute, queues | No Node.js |
Hybrid Architecture
For complex apps, consider hybrid:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HYBRID ARCHITECTURE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Frontend (Cloudflare Pages) β
β ββ Static assets (CSS, JS, images) β
β ββ Edge-rendered pages (fast TTFB) β
β ββ Cloudflare KV for session cache β
β β
β βΌ API calls β
β β
β API (Vercel Functions) β
β ββ Node.js runtime for DB access β
β ββ Prisma/Drizzle with PostgreSQL β
β ββ Server-side auth (Prisma sessions) β
β β
β βΌ Background jobs β
β β
β Workers (Railway/Render) β
β ββ Cron jobs (hourly+) β
β ββ Email sending β
β ββ Heavy processing β
β β
β Result: Edge speed + Node.js power + Background processing β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Cost Optimization Tips
- Start on Cloudflare if you're unsure - it's free and generous
- Migrate to Vercel only when you hit Node.js requirements
- Use Vercel Edge when possible (cheaper than Serverless)
- Cache aggressively on Cloudflare (KV, R2, Workers KV)
- Use ISR with long revalidation periods when real-time isn't critical
- Monitor usage - set billing alerts on both platforms
- Consider Railway for backend services (cheaper than Vercel for workers)