# Why every route on this site is static

URL: https://www.kevinpierik.dev/posts/why-every-route-is-static
Published: 2026-11-24

> How I keep a Sanity site fully prerendered in Next.js 16, and why a personal site doesn't need a server.

This site has no server. Every page is HTML that Next.js renders once, at build time, and Vercel serves from its CDN. Nothing runs when you open a page, so nothing can be slow or break at that moment.

## Content from Sanity, rendered at build time

Pages and posts live in Sanity. The build reads every published document and prerenders a page for each one with generateStaticParams. The site only reads published content, so it needs no API token.

When I publish in the Studio, a Sanity webhook calls a Vercel Deploy Hook, and production rebuilds about a minute later. That is the whole publishing pipeline.

## One rule, checked on every change

Every route has to build as static (○) or prerendered (●). A single ƒ in the build output means something became dynamic. The usual causes:

- cookies(), headers(), draftMode() or searchParams in a page, layout or generateMetadata
- a fetch with cache: "no-store" or revalidate = 0
- a route handler without export const dynamic = "force-static"

One dynamic API in a shared layout makes every route below it dynamic, so it is easy to lose without noticing. CI builds the site on every pull request, and the rule is written down for the coding agents that work on this repository too.

```typescript
export const dynamic = "force-static";

export async function GET() {
  return new Response(await buildFeed());
}
```

## Why bother

A personal site doesn't need a server. Static pages load instantly, cost nothing to serve, and can't go down when a function times out. Even feed.xml, llms.txt and the Markdown version of each post are route handlers that render once at build time.