Static Route

staticRoute() marks a page for pre-rendering at build time. The HTML is generated once during catmint build and served as static content. This is ideal for pages that don't need per-request data.

Build-Time Data

This timestamp was captured when the page was rendered:
2026-03-01T21:46:57.904Z
Refresh the page — in production, this timestamp stays the same because the page was pre-rendered at build time.

Environment Info

Node.js
v22.22.0
Platform
linux
PID
4
Uptime
215s

Usage

import { staticRoute } from "catmint/cache"

export default staticRoute(function MyPage() {
  // This runs at build time, not per-request
  return <div>Pre-rendered content</div>
})

// For dynamic routes, provide paths:
export default staticRoute(
  function BlogPost() { ... },
  {
    paths: async () => [
      { slug: "hello-world" },
      { slug: "getting-started" },
    ]
  }
)
  • Wraps your page component — the framework detects __catmintStatic metadata
  • Cannot access runtime request data (headers, cookies, query params)
  • For dynamic routes (e.g., /blog/[slug]), provide a paths function that returns all parameter combinations
  • In dev mode, the page still renders per-request for convenience