Next.js Demo Website

Next.js Demo Website

loading...


This page uses client side rendering by using swr(). By using swr(), you first get a static html page without any data. Then the client will call and retireves the data from the Random User API and populates the page with the text and images from the API. swr() is a little more complecated than that, but that's just the basics.

Everybody who visits this site will see a different user. Refreshing the page will make you call the API again and send an updated page.

Client side generation should be used on websites where the data is specific to a certain user. Their data changes constantly and needs to be up-to-date with every request. This method of rendering is bad for SEO, since Google has to use their JS bots to see what is on the website.

This is the normal way react and create-react-app renders a page. It should be used on private, user-specific pages where SEO is not relevant. Without JS, this page will not load anything that has not been staticly generated.

Examples of Rendering Strageties



Source Code