All posts

Next.js and Vercel in Production: What We Learned Shipping Client Apps

Caching finally fixed, auth lessons from a 9.1 CVE, what Vercel actually costs after Fluid Compute, and the projects where we steer clients away from Next.js entirely.

Max SheikhizadehFounder & CTO, DevX Group6 min read

Next.js 16 on Vercel is still our default stack for client web apps in 2026, and the honest answer to "should you use it" is: yes for content-driven products and full-stack apps that need SEO, no for static brochure sites and no for internal dashboards that live behind a login. The framework got meaningfully better this year (Turbopack is now the default bundler with 2 to 5x faster production builds, and the old caching confusion finally has a fix), while Vercel's Active CPU pricing removed the worst of the serverless bill anxiety. But we've shipped enough client projects on this stack to know where it bites. This is the list we wish someone had handed us.

We run devxgroup.io on this exact stack, plus most of our client web builds. What follows is from production, not from the docs.

Caching was the problem. Explicit caching is the fix.

If you used the App Router between 2023 and 2025, you fought the cache. Four separate layers (request memoization, data cache, full route cache, router cache), several implicit defaults, and stale data bugs that most engineers could only partially explain. Even Vercel's own list of common App Router mistakes is mostly caching surprises.

Next.js 16 ships Cache Components: one flag, and caching becomes fully opt-in. Nothing is cached unless you mark it with "use cache", and partial prerendering becomes the default behavior for marked pages, so the static shell serves instantly while dynamic parts stream in. It's the first version of the caching model we'd describe as predictable. If you're starting a project today, turn it on from day one. Retrofitting explicit caching onto a codebase that grew up on implicit caching is much more work.

Don't put auth only in middleware

In March 2025, CVE-2025-29927 let attackers skip Next.js middleware entirely with a single crafted header. Severity 9.1. Any app that enforced auth exclusively in middleware was open.

The lesson stuck with us: middleware is a convenience layer, not a security boundary. We layer checks. Middleware redirects unauthenticated users for UX, but every server action and route handler validates the session again, and the database enforces row-level security underneath. When the middleware layer failed industry-wide, apps built this way didn't leak. Next.js 16 replaced middleware.ts with proxy.ts running on the Node runtime, which is clearer about what that layer is for: routing, not protection.

What Vercel actually costs in 2026

The horror stories you've read ($96k in a month, a $46k bill for a mostly-static site) are mostly from the pre-2025 pricing model, where every request held a function instance and you paid for wall-clock time while your code waited on a database or an LLM.

Two changes rewrote that math. Fluid Compute lets one function instance serve many concurrent requests, and Active CPU pricing bills CPU only while code is actually computing. I/O wait costs zero CPU. For AI workloads, where a function spends 28 of its 30 seconds waiting on a model API, Vercel claims up to 90% savings, and our own function bills match the direction if not always the magnitude.

What still surprises people in 2026: bandwidth (a 3MB page burns through the 1TB Pro allowance at scale), bot traffic spiking invocations, and monorepo build minutes. The fixes are unglamorous: set spend caps, turn on the firewall, optimize images, and cache aggressively now that caching is explicit. One agency writeup documents cutting a client's bill from over $700 to about $120 a month with exactly this kind of cleanup. Misconfiguration drives most overage, not the platform.

Performance is a revenue feature, not a vanity metric

The strongest argument for this stack is what it does to Core Web Vitals, and what Core Web Vitals do to conversion. Rakuten 24's A/B test tied good LCP to a 53.4% lift in revenue per visitor. Deloitte's much-cited finding holds that a 0.1 second mobile speed improvement can lift conversions by up to 8.4%. Meanwhile only about half of websites pass all three Core Web Vitals, so passing them is still a competitive edge, not table stakes.

Server components, streaming, and partial prerendering exist to win exactly this game. But the framework only gives you the ceiling. You still have to do the work: code-split the heavy stuff, lazy-load below the fold, and measure on real devices.

When we steer clients away from Next.js

An honest agency tells you when the default is wrong:

  • Brochure sites and portfolios. Server components and a caching model are overhead you don't need. Astro or plain HTML ships faster and lighter.
  • Internal tools and dashboards behind a login. SEO doesn't matter and first paint barely matters. Vite plus React is simpler and the build stays fast forever.
  • Long-running background work. Vercel functions cap at 800 seconds even on Enterprise. Queues, workflows, or a container belong in the architecture instead.
  • Teams allergic to platform coupling. Self-hosting Next.js is officially supported and got easier (the Build Adapters API exists precisely because of lock-in criticism), but features like ISR and remote caching need real setup work off-Vercel. Budget for it or stay on Vercel.

What this means if you're hiring a team

Ask whoever builds your next web app three questions. How do they handle caching in Next.js 16? Where does auth live besides middleware? What's the plan when the Vercel bill spikes? The answers separate teams that read the changelog from teams that shipped through the changes. If you'd rather skip the vetting, this is what we do all day, and our portfolio shows the receipts.

FAQ

Is Next.js still worth it in 2026?

Yes for marketing sites, e-commerce, SaaS products, and anything where SEO and load speed drive revenue. No for static brochure sites (use Astro) or login-gated dashboards (use Vite plus React). Next.js 16 fixed its biggest historical pain, implicit caching.

Is Vercel expensive?

For most small to mid-size products, no. Fluid Compute and Active CPU pricing (2025) cut function costs sharply, especially for AI and database-heavy workloads. The remaining cost risks are bandwidth, bot traffic, and build minutes, all controllable with spend caps, the firewall, and asset optimization.

Should I self-host Next.js instead of using Vercel?

Self-host when you have ops capacity and predictable high traffic, where a flat-cost server wins. Stay on Vercel when your team is small and shipping speed matters more than infrastructure control. Self-hosting works but you own caching infrastructure, image optimization, and deployment orchestration yourself.

What was the biggest Next.js mistake you see in client codebases?

Trusting middleware as the only auth check, and fighting implicit caching with random revalidate values instead of understanding the layers. Both have clear fixes in 2026: layered auth checks, and Cache Components with explicit "use cache" boundaries.

Max Sheikhizadeh

Founder & CTO, DevX Group

Max builds web, mobile, and on-device AI products for clients and for DevX Group's own product line. If you're weighing a build like the ones in this post, he'll scope it with you honestly.