SSG

Static Site Generation

Next.js creates the HTML ahead of time, then every visitor gets the same static file.

Initial HTML

Build

Initial Paint State

Static HTML from build

Before hydration

Data in initial HTML

Yes

HTML generated by

Build

User sees first

Prebuilt content immediately

Real-Time Rendering Timeline

Request to interactive UI

Performance API
1waiting

Request

Document request started

2waiting

HTML

HTML response received

3waiting

FCP

First contentful paint

4waiting

JS

Client JavaScript running

5waiting

Hydration

React effects can run

6waiting

Fetch

Client data request started

7waiting

Fetch done

Client data response resolved

8waiting

UI

React committed new data

Live Comparison

Production vs naive client updates

Same endpoint, same 3s cadence

TanStack Query

Production Pattern

Cached
TanStack QueryCachedBackground Refetch

Live Backend Metric

103.90

+3.21

Updated at

2026-05-04T13:15:25.561Z

Telemetry

Rendered at

01:15:25 PM

Data fetched at

01:15:25 PM

Render source

Build

Hydrated

No

Request count

1

Last update

01:15:25 PM (6 ms ago)

Cache status

Cached

Update mode

Background refetch

useEffect Fetch

Naive Pattern

Client Fetching
useEffect FetchNo CacheClient Only
Local state is empty until fetch resolves

Telemetry

Rendered at

01:15:25 PM

Data fetched at

Pending

Render source

Browser

Hydrated

No

Request count

0

Last update

Pending

Cache status

No cache

Update mode

Blocking fetch

What to notice

Initial render

Initial render is build-driven.

Production update

Cached + background refetch

Naive update

Loader + client-only fetch

Where HTML is generated

Build

When

During next build

Rendered at

2026-05-04T13:15:25.562Z

1Build Process

Run next build

Next.js executes the static page before users visit it.

RUNNING / Build step
2Data API

Fetch posts once

Data is captured at build time.

WAITING / Build-time fetch
3Build Process

Write static HTML

The finished page is saved as deployable static output.

WAITING / Static artifact
4CDN Cache

Serve same file

Each request gets the already generated HTML.

WAITING / Cache hit
5Browser

Display instantly

No request-time rendering is needed.

WAITING / HTML response

Now happening

Build Process: Next.js executes the static page before users visit it.

Rendered at
2026-05-04T13:15:25.562Z
Data fetched at
2026-05-04T13:15:25.561Z
Rendered on
Build
Data source
English teaching dataset
Revalidate time
None

Behind the scenes

  1. Build Process

    Run next build

  2. Data API

    Fetch posts once

  3. Build Process

    Write static HTML

  4. CDN Cache

    Serve same file

  5. Browser

    Display instantly

Static route

force-static tells Next.js the initial page can be generated at build time.

Stable timestamp

In production, the initial render timestamp stays the same until the next build.

Client updates still work

TanStack Query and the naive fetch both run in the browser, so live updates are separate from static page generation.