Languages

Next.js - what is Static Site Generation? (SSG)

3 points
Asked by:
chelsea
806

Can you explain to me what is Static Site Generation in Next.js?

1 answer
3 points
Answered by:
chelsea
806

Static Site Generation, also called pre-rendering allows you to render your application at build time.

SSG is a software that generates a complete, static HTML website from plain text files, typically written in markdown format. The HTML, CSS, and JavaScript files generated by the SSG are served by a web server without any server-side processing or database queries. This makes websites fast, secure, scalable, easy to deploy and host.

In Next.js each page or component can implement a function called getStaticProps(), that can fetch data from the database and then pass the data as props to the component.

You can then build your application to render all the HTML locally and upload it to the storage bucket when it can be easily cached by a CDN. It works great for applications where the data doesn't change often, like e.g. blogs.

0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join