Reactjs 当`getStaticPaths()获取所有帖子时,性能会有影响吗?总共有一百万篇帖子?

Reactjs 当`getStaticPaths()获取所有帖子时,性能会有影响吗?总共有一百万篇帖子?,reactjs,asynchronous,next.js,getstaticpaths,Reactjs,Asynchronous,Next.js,Getstaticpaths,我对这件事很好奇;在中,pre-render将获取所有帖子并将其映射到基于id的数据 当帖子总数超过一百万篇时,这会影响性能吗 export async function getStaticPaths() { // Call an external API endpoint to get posts const res = await fetch('https://.../posts') const posts = await res.json() // Get the paths

我对这件事很好奇;在中,pre-render将获取所有帖子并将其映射到基于id的数据

当帖子总数超过一百万篇时,这会影响性能吗

export async function getStaticPaths() { 
 // Call an external API endpoint to get posts
 const res = await fetch('https://.../posts')
 const posts = await res.json()

 // Get the paths we want to pre-render based on posts
 const paths = posts.map((post) => `/posts/${post.id}`)

 // We'll pre-render only these paths at build time.
 // { fallback: false } means other routes should 404.
 return { paths, fallback: false }
}