It's ok on Next js to do multiple same request on different component like page.tsx, header.tsx ?
Unanswered
Fire ant posted this in #help-forum
Fire antOP
I want to make exacty the same request in multiple different components, it will increase the load times or not ? How does Next js deal with that ? Thanlk you.
5 Replies
@Fire ant I want to make exacty the same request in multiple different components, it will increase the load times or not ? How does Next js deal with that ? Thanlk you.
it will increase the load time, yes. However: when you wrap it inside a react cache the load time will normal
Fire antOP
Thank yoou, if i put 'cache: force-cache': in the fetch options, it should be ok no ?
@Fire ant Thank yoou, if i put 'cache: force-cache': in the fetch options, it should be ok no ?
fetch requests will be memorized automatically, when they have the same url, the same options and are with GET as method
@Fire ant solved?
Fire antOP
Oups sorry, solved thanks ; )