SSR - Server-Side Rendering

How it works: This page is generated on every request. The API call to JSONPlaceholder happens each time someone visits this page. Refresh to see the timestamp update!

Pros: Always fresh data, good SEO, personalized content

Cons: Slower than SSG, server load on each request

Users (Fetched on Each Request)

Leanne Graham

@Bret

Sincere@april.biz

Gwenborough

Ervin Howell

@Antonette

Shanna@melissa.tv

Wisokyburgh

Clementine Bauch

@Samantha

Nathan@yesenia.net

McKenziehaven

Patricia Lebsack

@Karianne

Julianne.OConner@kory.org

South Elvis

Chelsey Dietrich

@Kamren

Lucio_Hettinger@annie.ca

Roscoeview

Mrs. Dennis Schulist

@Leopoldo_Corkery

Karley_Dach@jasper.info

South Christy

Kurtis Weissnat

@Elwyn.Skiles

Telly.Hoeger@billy.biz

Howemouth

Nicholas Runolfsdottir V

@Maxime_Nienow

Sherwood@rosamond.me

Aliyaview

Glenna Reichert

@Delphine

Chaim_McDermott@dana.io

Bartholomebury

Clementina DuBuque

@Moriah.Stanton

Rey.Padberg@karina.biz

Lebsackbury

Code Example:

export default async function SSRPage() {
  // Fetch happens on EVERY REQUEST
  const response = await fetch('https://api.example.com/users', {
    cache: 'no-store' // This forces SSR
  })
  const users = await response.json()
  
  return <div>{/* Render users */}</div>
}