what is the next.config for showing fetches in the console to see revalidations in the background?
To see fetch requests and revalidations in the console, you can add the logging
option to your next.config.js
file 1. This is particularly useful for debugging Incremental Static Regeneration (ISR) and understanding which requests are cached or uncached.
Here's how to configure it:
// next.config.js
module.exports = {
logging: {
fetches: {
fullUrl: true,
},
},
}
With this configuration, Next.js will log detailed information about fetch requests, including:
If you specifically want to debug ISR behavior in a production-like environment, you can:
next build
followed by next start
to simulate production behavior.env
file 1:NEXT_PRIVATE_DEBUG_CACHE=1
This will make the Next.js server console log ISR cache hits and misses, helping you understand how pages are being generated and revalidated.