A route handler that returns config should be force-static
A GET route that reads files or constants is dynamic by default and runs on every request. Marking it static makes it a file in the build output.
export const dynamic = "force-static";
export function GET() { return Response.json({ posts: index() }); }Anything that only changes on deploy fits: a search index, a sitemap fragment, a manifest. Pair it with revalidate if it changes on a schedule instead.
nextjsperformance