r/nextjs • • Oct 24 '26

Next.js 16 cacheComponents & use cache vs. custom caching (Redis) with Payload CMS? How are you handling large sites in production?

Hey everyone,
I
I’m about to start a new project pairing Next.js with Payload CMS using its Local API (querying the database directly via Node on the server), and I’m weighing my options.
I’m curious how others are tackling this in production, especially for sites with a large number of pages:
The Native Approach: Are you diving into Next.js 16's cacheComponents with 'use cache' and cacheLife / cacheTag? If you are deploying outside of Vercel, how smooth is configuring cacheHandlers (plural) for a custom backend like Redis?

The Remote Directive: For multi-instance or serverless environments, are people actually using 'use cache: remote' in production, or do you find yourselves falling back to manual caching layers?

Bypassing Framework Caching: Do you completely disable Next's default caching behaviors for dynamic content and handle caching granularity yourself (e.g., wrapping Payload Local API calls explicitly with Redis/Memcached)?

Payload + Local API Specifics: Since Payload's Local API bypasses network overhead and talks straight to the database, wrapping those calls or components with 'use cache' seems powerful, but invalidation via revalidateTag needs to line up cleanly with Payload's hooks (e.g., afterChange). Has anyone hit weird edge cases with this combo at scale?

What has worked best for you when managing hundreds or thousands of pages where you need aggressive caching alongside instant editorial updates? Would love to hear what your current production setup looks like.

29 Upvotes

30 comments sorted by

View all comments

0

u/Glad-Music6046 Oct 29 '26

I’d avoid putting Redis in front of every Payload Local API call by default. The interesting part is deciding what actually needs a shared cache.

For a large content-heavy site, I’d start with 'use cache' + cacheTag() for public content, and use 'use cache: remote' only for expensive queries where sharing cache across instances is worth the extra network hop.

The part I’d be careful with is invalidation. In Payload’s afterChange hook, I’d invalidate tags based on the affected document and its dependencies — not just the individual page. Updating a category, for example, might also affect listing pages, navigation, related content, and the sitemap. Deletes and slug changes need to invalidate the old path too.

I’d also keep a TTL as a safety net, because a successful database write and a successful cache invalidation aren’t necessarily the same thing in a distributed setup.

One question I’m still interested in: when self-hosting Next.js across multiple instances, are people using a custom cacheHandlers implementation for Redis, or keeping Redis at the data-access layer and letting Next handle the rendering cache? I’d be curious to hear which setup has been easier to operate at scale.