Skip to content
Built with

Edge prerendering ​

Build & Deploy

Prerender pages when you deploy, so the first visitor already gets cached HTML.

On this pagePrerender static and dynamic pages · Use prerendering with custom SSR · Combine it with revalidation

Static pages (no params) ​

This step prerenders a page without params. Export prerender = true from its .server.ts file.

ts
// pages/about.server.ts
export const prerender = true;

Pages without dynamic params do not need getPrerenderPaths().

Dynamic pages (with params) ​

This step prerenders a page with URL params. Also export getPrerenderPaths() to list the params to render.

ts
// pages/blog/[slug].server.ts
export const prerender = true;

export async function getPrerenderPaths() {
  // Return param objects matching the URL pattern
  return [{ slug: 'hello-world' }, { slug: 'getting-started' }];
}

Custom SSR ​

This step prerenders in custom SSR mode (src/main.ssr.ts). Export getPrerenderPaths() at the top level. There is no file-based routing, so return full paths.

ts
// src/main.ssr.ts
export const prerender = true;

export async function getPrerenderPaths() {
  return ['/', '/about', '/blog/hello-world'];
}

Relationship to revalidation ​

routing.isr: false in void.config.ts turns off ISR and edge prerendering, including per-page exports. It does not turn off build-time HTML from output: "static".

Prerendered pages default to a one-year revalidate TTL. Deploys clear the ISR cache.

This step overrides the TTL for one page.

ts
// pages/about.server.ts
export const prerender = true;
export const revalidate = 3600;

If the cached page expires before the next deploy, the next request waits for a fresh render.

Behavior details ​

  • Prerendering runs once per deployment, before traffic moves to the new version. The pages are cached at the edge.
  • Only paths with a positive revalidate TTL are prerendered (TTL 0 is skipped).
  • Prerender failures are logged and never block the deploy. The page renders on its first request instead.

Next steps ​

implemented.stream AI