Next.js Discord

Discord Forum

Avoid an excessive DOM size

Unanswered
West African Crocodile posted this in #help-forum
Open in Discord
West African CrocodileOP
I'm curious if any core contributors can answer with best practices for dealing with Lighthouse and DOM size. I am rendering header/footer navigation on server-side (Next 14, pages router) using getServerSideProps and hydrating on the client side. This way SEO crawlers can see the full markup for navigation.

However, in doing so I end up needing to increase largePageDataBytes config setting to over 1MB (lots of subnavigation...ecommerce) as well as receive warnings from Lighthouse about excessive DOM size.

Curious what the current recommendation is to handle for this scenario / best practices?

0 Replies