ReasonJun

SSG (Static Site Generation) / ISR (Incremental Static Regeneration.) 본문

Frontend/Network

SSG (Static Site Generation) / ISR (Incremental Static Regeneration.)

ReasonJun 2023. 6. 18. 00:07
728x90

SSG and ISR are two different ways of rendering web pages. SSG stands for Static Site Generation, and ISR stands for Incremental Static Regeneration.

 

SSG is a technique where the pages of a website are rendered on the server before the user requests them. This means that the pages are pre-rendered and served to the user as static files.

 

SSG has a number of benefits, including:

  • Faster page load times: Because the pages are pre-rendered, they can be served to the user much faster than if they were rendered on the client.
  • Better SEO: Because the pages are static, they can be indexed by search engines more easily.
  • Reduced load on the server: Because the pages are pre-rendered, the server does not have to render them on every request.

ISR is a technique that combines the benefits of SSG with the flexibility of client-side rendering. With ISR, the pages of a website are rendered on the server, but they are also updated dynamically when the data changes. This means that the pages can be served to the user quickly, but they can also be updated in real time.

 

ISR has a number of benefits, including:

  • Fast page load times: Like SSG, ISR can deliver pages quickly to users.
  • Real-time updates: ISR can update pages in real time, which is important for applications that need to be up-to-date.
  • Reduced load on the server: Like SSG, ISR can reduce the load on the server by pre-rendering pages.

The main difference between SSG and ISR is that SSG renders the pages completely on the server, while ISR renders the pages on the server and then updates them dynamically on the client.

 

Which one should I use?

 

The best choice for you will depend on your specific needs. If you need to serve pages quickly and improve your SEO, then SSG is a good option. If you need to update pages in real time, then ISR is a good option.

 

Here is a table that summarizes the key differences between SSG and ISR:

 

Feature SSG ISR
Rendering Pages are rendered on the server. Pages are rendered on the server and then updated dynamically on the client.
Benefits Faster page load times, better SEO, reduced load on the server. Faster page load times, real-time updates, reduced load on the server.
Use cases Websites that do not need to be updated in real time. Websites that need to be updated in real time.

 

Rendering Strategy  When is the HTML generated?
Static Site Generation (SSG) At build time
Incremental Static Regeneration (ISR) At request time
728x90
Comments