I've seen too many Next.js apps crumble under load. They work great in development, but the moment a marketing blast hits, the database CPU spikes to 100% and Vercel bills skyrocket.
Scaling to 100k+ Daily Active Users (DAU) requires moving beyond the basics.
1. Master the `unstable_cache`
The App Router's caching mechanisms are powerful but complex. The key is granularity.
Don't just cache the page. Cache the data fetch. Using `unstable_cache`, you can wrap expensive DB queries and tag them.
```typescript const getCachedUser = unstable_cache( async (id) => db.user.findUnique({ where: { id } }), ['users'], { tags: [`user-${id}`] } ); ```
This allows you to revalidate *only* when that specific user changes.
2. Partial Prerendering (PPR)
Static generation (SSG) is great, but modern apps are dynamic. PPR is the holy grail. It allows you to encase dynamic parts (like a "User Profile" header) in Suspense boundaries, serving the static shell instantly from the Edge.
3. Move Logic to the Edge
Middleware is your first line of defense. Do you really need to hit your Node.js server to check if a user is banned? No. Do that checking at the Edge using a lightweight KV store (like Vercel KV or Upstash).
Conclusion
Scaling isn't magic; it's architecture. It's about knowing *where* to compute.
If your Next.js app is sluggish, you might need a Modernization Audit. We specialize in turning slow monoliths into screaming fast distributed systems.
Need a review? Book a Technical Audit today.