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.

28 Upvotes

30 comments sorted by

View all comments

2

u/AbdelrhmanDev Oct 24 '26

with payload local api the pattern that scaled for me was tag based invalidation, tag each cached query with the collection and doc id, then call revalidatetag from the afterchange hook. path based invalidation falls apart on a large site because one doc shows up on lists, related sections and search pages you forgot about. tags mean you never track where content appears, the hook just knows what changed

1

u/imkb9 20d ago

Ok so lets say on /docs/123 you fetch getDoc(123) and cache it doc:123.

What if you also have a /docs page that retrieves a list of docs implicity and the doc is part of the response? If the response contains 100 docs, are you looping through it to cache each one of them (doc:${id})? Otherwise it will serve stale data for that doc. What if getDocsWithAuthors() retireves the doc and its related authors. Would you create nested loops after the api request to cache docs and authors??