Currently, the /convene/[name] routes are being dynamically rendered and is a client component. This means it unnecessarily uses serverless function execution time when it should instead be rendered statically.
Solution
I turned the pages into static pages with generateStaticParams() and composed the actual data fetching to a client component inside it.
export async function generateStaticParams() {
return Object.keys(bannerMetadata) as BannerTypeSlugEnum[];
}
Testing
Here is the performance on a forced reload (CTRL + F5). Performance it noticeably better since we can prefetch the <Link /> components on the sidebar.
Problem Context
Currently, the
/convene/[name]
routes are being dynamically rendered and is a client component. This means it unnecessarily uses serverless function execution time when it should instead be rendered statically.Solution
I turned the pages into static pages with
generateStaticParams()
and composed the actual data fetching to a client component inside it.Testing
Here is the performance on a forced reload (
CTRL + F5
). Performance it noticeably better since we can prefetch the<Link />
components on the sidebar.Closing Issues
None.