SSG

Static Site Generation

Generated at

2026-09-17T11:13:24.121Z

How it works

  1. This page is a Server Component with dynamic = "force-static".
  2. Next.js renders the HTML once during `next build` and stores it.
  3. Every later request is served that same HTML. The timestamp does not move until you rebuild.
  4. Use SSG for pages that are the same for every visitor and rarely change, such as marketing copy.

How to test

  1. Run a production server: `npm run build && npm run start` in client/. Dev mode (`npm run dev`) re-renders on every request, so SSG will look like SSR.
  2. Open /ssg and copy the Generated at value.
  3. Refresh several times. The timestamp must stay identical.
  4. In another terminal run `curl -sI http://localhost:3000/ssg` and look for x-nextjs-cache: HIT (after the first request).
  5. Rebuild (`npm run build && npm run start`). The timestamp should change to the new build time, then stay frozen again.