Layout forces dynamic rendering

data/force-dynamic-layoutwarningperformancenextjs-16

Why it matters

dynamic = "force-dynamic", revalidate = 0 or fetchCache = "force-no-store" in a layout opts every page below it out of static rendering and the data cache.

Fix

Move the segment config to the pages that need per-request rendering, or read cookies()/headers() only where needed.

Credit

  • From the Next.js team

    Route segment config dynamic = 'force-dynamic' on a layout opts every route beneath it out of static rendering.

References