Post-It
post
  27, Jan, 2022

Next js and SSR

Here’s a quick graphical summary: ⁠ ⁠ ⁠When to Use v.s.

We recommend using (with and without data) whenever possible because your page can be built once and served by CDN, which makes it much faster than having a server render the page on every request.

You can use for many types of pages, including:

You should ask yourself: "Can I pre-render this page ahead of a user's request?" If the answer is yes, then you should choose .

On the other hand, is not a good idea if you cannot pre-render a page ahead of a user's request. Maybe your page shows frequently updated data, and the page content changes on every request.

In that case, you can use . It will be slower, but the pre-rendered page will always be up-to-date. Or you can skip pre-rendering and use client-side JavaScript to populate frequently updated data.

Egor

Egor

Front End Developer. Creator and administrator of the post-it website

Leave a comment

Related Posts

0

Categories

Post-It © Egor Cravcenco 2022

Any resemblance to real persons or other real-life entities is purely coincidental. All characters and other entities appearing in this work are fictitious.