Next.js performance is not as good as Astro #27531
Unanswered
thanhtoan1196
asked this question in
Help
Replies: 1 comment
-
Seems like this should be more of a feature enhancement than a help question. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://docs.astro.build/comparing-astro-vs-other-tools#nextjs-vs-astro
Comparing Next.js vs. Astro Performance
In most cases, Astro websites will load significantly faster than Next.js websites. This is because Astro automatically strips unnecessary JavaScript from the page, hydrating only the individual components that need it. This feature is called partial hydration.
Next.js doesn’t support partial hydration, and instead has the user load and rehydrate the entire page in the browser, even if most of the page content is static. This creates a slower page load and worse performance for your website. Next.js has experimental support for fully-static, zero-JavaScript pages. However, there is no planned support for hydrating individual components on the page. This leaves you with an all-or-nothing decision for interactivity on each page.
Case Study: Building a Documentation Website
nextjs.org/docs is the official Next.js documentation website, built with Next.js. The website offers a similar enough design and featureset to compare against the official Astro documentation website. This gives us a rough, real-world comparison between the two site builders for this common use-case.
One big reason behind this performance difference is Astro’s smaller JavaScript payload: nextjs.org/docs loads 463kb of JavaScript on first load while docs.astro.build only loads 9.3kb (98% less JavaScript, overall).
Beta Was this translation helpful? Give feedback.
All reactions