Skip to main content

Nextjs App Costs

Cost is an architecture signal. If your bill surprises you, your architecture surprised you first.

Every rendering strategy, data fetch, and image transformation has a price. Know the meter before you ship.

The Life of a Vercel Request

Cost Optimization

ResourceWhat Costs MoneyOptimizationSavings
Serverless functionsInvocation count + durationCache aggressively, reduce cold starts50-80%
Edge functionsInvocation count (cheaper per call)Move auth/redirects to edge30-60%
Image optimizationTransformation countUse sizes prop, limit formats40-70%
BandwidthData transfer outStatic generation, CDN caching50-90%
Build minutesBuild timeIncremental builds, turborepo cache30-50%
ISR revalidationBackground regeneration callsLonger revalidation windowsCase by case
Database (Vercel Postgres)Rows read + storageConnection pooling, query optimization20-50%

Rendering Cost

StrategyCost ProfileWhen
Static (SSG)Build time only, zero runtimeContent that changes rarely
ISRBuild + periodic revalidationContent that changes hourly/daily
SSREvery request costsPersonalized, real-time data
Client-sideZero server cost, user paysInteractive features, dashboards
Edge SSRCheaper per request, globalAuth, A/B tests, geolocation

Warning Signs

SignalWhat It Means
Bill doubles month over monthLikely a rendering strategy mistake
High function durationCold starts or slow database queries
Image optimization spikeMissing sizes prop or too many unique transforms
Bandwidth spikeNot caching static assets, or SSR where SSG works

How do costs and benefits compare with Fleek?

Context

  • Performance — Performance optimization reduces cost directly
  • App Router — Rendering strategy is the biggest cost lever
  • Tech Stack — Platform choices set the cost floor
  • Anti-patterns — Most cost problems are architecture problems
  • Metrics — Track cost as a first-class metric

Questions

What rendering strategy minimizes cost for your traffic pattern?

  • At what traffic level does self-hosting beat Vercel?
  • How do you set cost alerts before the bill arrives?
  • What is the true cost difference between edge and serverless functions at scale?