Next.js Discord

Discord Forum

Double fetch on headless jamstack

Unanswered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
Hi, I am using new app router layout. I have two endpoints I need to call per page, one to fetch page content, and one for the page/site settings (footer/nav)

Should I make a data call in layout.js to pass footer/nav etc and make a second data call in page.js, or should I have both calls inside page.js with Promise.all?

1 Reply

layouts are not re-rendered during navigation, it depends on how you cache the data. Normally it doesn't matter