Skip to content

SYSTEM Cited by 7 sources

Next.js

Next.js is a Vercel-backed React application framework providing server-side rendering, file-system-based routing, app router, API routes, image optimization, and caching / revalidation primitives. Historically opinionated toward Vercel as the deployment target; systems/opennext fills the gap for other runtimes.

Stub

This page only covers Next.js capabilities named by currently- ingested sources. Broader Next.js architecture (App Router, Pages Router, ISR, RSC internals) is out of scope until a source describes them.

Relevant primitives (named by ingested sources)

  • force-dynamic (Next.js caching guide) opts a route out of static rendering. In the 2025-10-14 Cloudflare post, dynamic vs non-dynamic mode interacted with OpenNext's streaming behaviour: non-dynamic rendering buffers the full response before sending any bytes; dynamic mode streams.
  • Rendering pipeline uses pipeThrough() chains that (per Cloudflare profiling) allocate up to 50 × 2048-byte Buffer instances per request even when most aren't used.
  • Caching / deduplication — when multiple concurrent requests hit the same page, Next.js (via OpenNext's composable cache) deduplicates rendering to a single invocation.
  • JSON.parse(text, reviver) — used heavily internally; 100,000+ reviver invocations observed per request on the Cloudflare benchmark; hot enough that Cloudflare's V8 patch speeding up parse-with-reviver is a noticeable win.
  • rewrites() with has header matcher — declarative URL rewriting in next.config.ts with per-rule has conditions on headers, cookies, or query params. In Vercel's 2026-04-21 content-negotiation post, the has: [{ type: 'header', key: 'accept', value: '(.*)text/markdown(.*)' }] pattern is used to internally route agents to a dedicated /md/:path* route without changing the public URL. beforeFiles: ensures the rule runs before static-file serving. See patterns/accept-header-rewrite-to-markdown-route.
  • App Router route handlersexport async function GET() at app/<path>/route.ts returns a Response with custom Content-Type. Used in Vercel's 2026-04-21 post to serve text/markdown from on-the-fly CMS rich-text conversion, and to generate markdown sitemaps with export const dynamic = 'force-static';.
  • Next.js 16 remote cache (use cache) — named by Vercel's 2026-04-21 post as the primitive keeping HTML and markdown versions synchronised via shared slug keys when CMS content updates.

Seen in

  • sources/2026-04-21-vercel-making-agent-friendly-pages-with-content-negotiationcanonical Next.js instance of markdown content negotiation. Vercel ships markdown-content-negotiation on vercel.com/blog and vercel.com/changelog via a next.config.ts rewrite rule (patterns/accept-header-rewrite-to-markdown-route) that inspects the Accept header with has: [{ type: 'header', key: 'accept', value: '(.*)text/markdown(.*)' }] and routes matching requests internally to a dedicated /md/:path* route handler. The route handler reads the slug, calls getMarkdownContent() to convert CMS rich text to markdown on the fly, and returns the body with Content-Type: text/markdown. Canonical datum: ~500 KB HTML → ~3 KB markdown = 99.37 % payload reduction on one blog post. Also introduces markdown sitemaps at /blog/sitemap.md and /docs/sitemap.md generated by force-static route handlers, and an HTML-head <link rel="alternate" type="text/markdown"> tag pointing at /llms.txt as a fallback discovery mechanism. Fourth public-profile altitude for Next.js on the wiki alongside CPU profile (2025-10-14), vinext reimplementation (2026-02-24), Bun runtime benchmark (2026-04-21), and WDK file-based-routing integration (2026-04-21).
  • sources/2026-04-21-vercel-inside-workflow-devkit-how-framework-integrations-work — canonical file- based-routing framework in Vercel Workflow DevKit's integration map; one of the two launch-support frameworks (alongside Nitro). WDK outputs generated handler files into app/.well-known/workflow/v1 and Next.js's file-based routing auto-discovers them as HTTP endpoints — canonical file-based-routing side of the patterns/two-phase-framework-integration-pattern. Third altitude of Next.js wiki coverage alongside the 2025-10-14 CPU-profile analysis, 2026-02-24 vinext reimplementation, 2026-04-21 Bun runtime benchmark.
  • sources/2026-04-21-vercel-bun-runtime-on-vercel-functionscanonical wiki disclosure of Next.js as the framework showing the largest Bun-vs-Node.js gap on a multi-runtime function platform. Vercel's 2026-04-21 benchmark (cf-vs-vercel-bench, re-run with TTLB instead of TTFB, 1 vCPU / 2 GB, iad1): Bun cuts average latency 28 % on CPU-bound Next.js rendering workloads vs Node.js. Gap attributed specifically to Bun's Web-Streams + reduced GC overhead — same profiling finding as Cloudflare's 2025-10-14 OpenNext analysis at a different runtime. React SSR / SvelteKit / vanilla JS workloads show no meaningful gap. Vercel also promises further gains from integrating Bun's optimised react-dom/server implementation. Canonical framework instance of concepts/web-streams-as-ssr-bottleneck.
  • sources/2025-10-14-cloudflare-unpacking-cloudflare-workers-cpu-performance-benchmarks — Cloudflare's profiling of cf-vs-vercel-bench surfaced Next.js internals (rendering pipeline, reviver usage, force-dynamic behaviour) as meaningful contributors to the apparent Vercel-vs-Workers gap.
  • sources/2026-02-24-cloudflare-how-we-rebuilt-nextjs-with-ai-in-one-week — Cloudflare reimplements the Next.js API surface from scratch on Vite as vinext in ~1 week / ~$1,100 in Claude tokens, hitting 94 % API coverage with 1,700+ Vitest + 380 Playwright tests ported from the Next.js repo. Canonical wiki instance of Next.js as a "well-specified target API" — extensively documented, massive user base, heavily represented in training data, comprehensive test suite portable as executable spec. Builds against 16.1.6 + Turbopack in the 7.38 s baseline benchmark; vinext comes in at 4.64 s (Rollup) and 1.67 s (Rolldown). Also surfaces the build-time-scales-linearly-with-generateStaticParams() pathology that vinext's Traffic-aware Pre-Rendering addresses by querying zone analytics at deploy time.
  • sources/2024-08-01-vercel-how-google-handles-javascript-throughout-the-indexing-processcanonical wiki instance of Google-side empirical indexing behaviour at nextjs.org scale. Vercel + MERJ instrument nextjs.org with an edge-middleware-injected beacon over April 2024 and measure Googlebot's rendering on 100,000+ fetches / 37,000+ server-beacon pairs. Confirms: (a) 100 % of indexable HTML pages rendered across the mix of SSG / ISR / SSR / CSR / RSC-streaming strategies on the site; (b) rendering-delay distribution p50 = 10 s, p75 = 26 s, p99 ≈ 18 h — see concepts/rendering-delay-distribution; (c) React 18 streaming SSR + RSC payloads fully captured by Googlebot; (d) ?ref=...-style query-string URLs render much slower than path-only (p75 ≈ 31 min vs 22 s). The rendering-strategy capability matrix grades Next.js's default strategies (SSG / ISR / SSR) as Excellent for crawl efficiency, rendering completeness, rendering time, and indexing; CSR is the outlier. Third public-profile altitude for Next.js on the wiki alongside the 2025-10-14 CPU profile and the 2026-02-24 vinext reimplementation — this one is the Google-facing SEO-at-scale altitude.
  • sources/2026-04-21-vercel-preventing-the-stampede-request-collapsing-in-the-vercel-cdncanonical Next.js ISR cache-stampede instance. Vercel frames Next.js ISR as the primary consumer of request collapsing: every Next.js ISR route deployed on Vercel now gets collapsing by default, because the Next.js build output tells the CDN which routes are ISR / SSG / dynamic. Named Next.js primitives the CDN relies on: route classification metadata (SSG vs ISR vs SSR vs dynamic API), revalidation windows (revalidate: N), and the deployment manifest that carries the classification to each CDN region. Operational numbers: 3M+/day ISR miss requests collapsed + 90M+/day ISR background-revalidation requests collapsed on the Vercel CDN. See patterns/framework-inferred-cache-policy for the general integration pattern and systems/vercel-cdn for the CDN system. Fourth public-profile altitude for Next.js on the wiki (CPU profile 2025-10-14, vinext 2026-02-24, MERJ study 2024-08-01, content-negotiation 2026-04-21) — now extended with the cache-tier-collapsing altitude.
Last updated · 542 distilled / 1,571 read