If a website is running on localhost, does Next.js have more performance than React.js?

20 views Asked by At

Let's say you're making a software in form of a Web App that the client would have to serve it himself.

Is there any performance advantage to use Next.js in this case?

1

There are 1 answers

0
Edele Gizatullin On

Yes. Next.js offers the following performance optimizations, to name a few:

  • <Image /> component automatically converts images to WebP and AVIF and serves the correct size depending on the client's screen pixel density. Images also load lazily when entering the viewport, which makes the initial page load faster.
  • If you use the App Router, you get Automatic Static Optimization, which allows you to send the built version of the site to the client, where your React components are translated into static HTML files, making the website load faster as it doesn't have to wait for the parsing of all the heavy JavaScript files (including React's library js code itself).

You can read more about optimizations in the docs: https://nextjs.org/docs/app/building-your-application/optimizing