I'm seeing an issue with fetching page data which comprises of 12+ components, each having a separate API endpoint to fetch the data from.
I was using this approach earlier but page performance seems to be taking a hit when making 12 requests like this -
const [getHeaderRes, getFooterRes] = await Promise.allSettled([
getHeader(),
getFooter(),
])
Do we continue to make requests like this or there is a better way ?
Maybe take API requests to component itself with good old useEffect ? But doesn't that nullifies the benefits of SSR ?