Back to Blog
Technical

Optimizing Next.js App Router for 100k+ DAU

18 min read

TL;DR(Too Long; Didn't Read)

To scale Next.js to 100k+ DAU, you must master the cache. We cover: 1) Moving personalized data to client-side fetch or PPR, 2) Aggressive `unstable_cache` usage for database calls, 3) Edge middleware for geo-routing. This stack handles spikes without breaking the bank.

Share:

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.

About This Content

This content was collaboratively created by the Optimal Platform Team and AI-powered tools to ensure accuracy, comprehensiveness, and alignment with current best practices in software development, legal compliance, and business strategy.

Team Contribution

Reviewed and validated by Slickrock Custom Engineering's technical and legal experts to ensure accuracy and compliance.

AI Enhancement

Enhanced with AI-powered research and writing tools to provide comprehensive, up-to-date information and best practices.

Last Updated:2026-01-03

This collaborative approach ensures our content is both authoritative and accessible, combining human expertise with AI efficiency.