Reading
headers() or cookies() inside a shared layout helper in Next.js quietly opts every child route out of static rendering without a single build warning. Moving that header check into middleware or a leaf component brought our cached route TTFB back down to 15ms.commit 6e06d86