Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

perf: render docs OG cards and Markdown on first request

kapishdima20112cd15eff
diff --git a/app/llms.md/[[...slug]]/route.ts b/app/llms.md/[[...slug]]/route.ts
index 20b0aa3a..fc2060f9 100644
--- a/app/llms.md/[[...slug]]/route.ts
+++ b/app/llms.md/[[...slug]]/route.ts
@@ -25,6 +25,9 @@ export async function GET(
});
}
+// No paths at build time: each page's Markdown is rendered on its first
+// request and cached until the next deploy. Prerendering all 875 doubled the
+// build's page count for files agents rarely ask for.
export function generateStaticParams() {
- return source.generateParams();
+ return [];
}
diff --git a/app/og/docs/[...slug]/route.tsx b/app/og/docs/[...slug]/route.tsx
index aaad79a1..4cfc168b 100644
--- a/app/og/docs/[...slug]/route.tsx
+++ b/app/og/docs/[...slug]/route.tsx
@@ -16,11 +16,11 @@ function sectionTitle(section: string): string | undefined {
export const dynamic = "force-static";
+// No paths at build time: each card is drawn on its first request (a crawler
+// or a link preview) and cached until the next deploy. Drawing all 875 PNGs
+// was the heaviest part of the build.
export function generateStaticParams() {
- return source
- .getPages()
- .map((page) => ({ slug: page.slugs }))
- .filter((p) => p.slug.length > 0);
+ return [];
}
export async function GET(