Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Where does Next JS stores the statically generated website and How Next JS app serving is different than vanilla HTML?

Next JS by default generates a static version of the website after building it the first time and then serves it when the user requests it. Wouldn’t that be opposite of what ReactJS does (Where React JS uses JS to generate the website at the client’s end.) and basically would be same as using vanilla HTML/CSS/JS?

Also, Where does Next JS stores the statically generated website? (Is it at the server where the website is hosted or somewhere else?)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Good question!

yes, it sounds a little counter-intuitive, so NextJS actually generates HTML markdown from react components, but the idea is to make it faster in the first-page load, but after that, the app will end up sending the rest of the javascript like a normal ReactJS app.

The objective of this is to respond to HTML always (so google and other SEO tools can "understand" your page without loading extra assets).

That HTML travels in the HTTP request and gets loaded to the page, but after that the real ReactJS gets loaded, adding interaction to those initial components loaded directly from HTML (that process is called hydration).

The statically generated files are built by NextJS on deployment, these files can be served by NextJS itself (when running on a self-hosted environment), or they can be uploaded to a more conventional website hosting solution.

If you need more details, let me know.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading