{"id":23,"type":"docs","title":"Next.js 16 for Agents: A Verifiable, Production-Ready App Router Guide","slug":"nextjs-16-agent-first-guide","canonicalUrl":"https://docs.phatysd.me/content/nextjs-16-agent-first-guide","status":"published","revision":3,"publishedAt":"2026-09-19T16:05:12.560Z","updatedAt":"2026-09-19T16:05:12.560Z","hierarchyPath":"Next.js > App Router > Agent-first development","topics":["Next.js","Next.js 16","App Router","AI agents","TypeScript","Production"],"tags":["nextjs","nextjs-16","app-router","agents","web-development"],"related":[],"body":"# Next.js 16 for Agents: A Verifiable, Production-Ready App Router Guide\n\n> Research snapshot: 2026-09-19 (Asia/Bangkok)  \n> Repository target: `web-blog`  \n> Installed version observed in this repository: `next@16.3.5`  \n> Official documentation: [Next.js Docs](https://nextjs.org/docs/app)\n\nThis guide is written for coding agents working on a current Next.js App Router codebase. It is not a syntax cheat sheet. The goal is to help an agent identify the correct runtime boundary, understand when data is evaluated, model cache invalidation, protect public interfaces, and verify work before claiming completion.\n\n## 1. Agent summary\n\nWhen a task arrives in a Next.js App Router project, follow this order:\n\n1. Read `AGENTS.md`, `package.json`, the lockfile, `next.config.*`, the `app/` tree, and the code touched by the task.\n2. Confirm the installed version from the lockfile or `node_modules/next/package.json`; do not infer APIs from an old tutorial.\n3. Classify the change by boundary: route, Server Component, Client Component, Server Action, Route Handler, data-access layer, or `proxy.ts`.\n4. State the data lifecycle explicitly: request-time, prerendered, cached, revalidated, or client-refetched.\n5. Enforce authorization in the data-access layer or mutation boundary; do not treat `proxy.ts` as the whole authorization system.\n6. Make the smallest scoped change and preserve existing public contracts and data shapes.\n7. Run typecheck, lint, available tests, a production build, and a smoke test for affected URLs.\n8. Report what was actually verified, separating `Observed`, `Inferred`, and `Unknown` evidence.\n\nIf repository documentation conflicts with remembered knowledge, use the installed version and its official documentation as the source of truth.\n\nNext.js also has an [AI Coding Agents guide](https://nextjs.org/docs/app/guides/ai-agents). An agent should read both the repository instructions (`AGENTS.md`) and the framework guide: framework documentation is authoritative for Next.js behavior, while `AGENTS.md` is authoritative for the repository's commands, boundaries, and workflow.\n\n## 2. Version baseline\n\nAt this snapshot, the project uses `next@16.3.5` through the `^16.3.5` package range, and the installed package is also `16.3.5`. The guidance here follows the current Next.js 16 App Router documentation as checked on 2026-09-19.\n\nImportant Next.js 16 facts:\n\n- Minimum Node.js version: `20.9`.\n- Minimum TypeScript version: `5.1`.\n- The Next.js 16 release is based on React 19.2.\n- Turbopack is the default path for development and production builds.\n- App Router uses React Server Components by default.\n- `params` and `searchParams` in pages, layouts, and route handlers are asynchronous APIs and must be awaited.\n- The newer convention is `proxy.ts` instead of `middleware.ts`; `proxy.ts` runs on the Node.js runtime.\n- `next lint` is no longer a Next.js command; invoke ESLint or the repository's lint tool directly.\n- `images.domains` is a legacy configuration; use the more restrictive `images.remotePatterns` instead.\n- Parallel route slots need `default.js` when a slot may have no matching segment.\n- Current `revalidateTag()` usage should provide a cache-life profile; use `updateTag()` in a Server Action when the mutation needs immediate read-your-writes behavior.\n\nCheck the [Next.js 16 release](https://nextjs.org/blog/next-16), [Version 16 upgrade guide](https://nextjs.org/docs/app/guides/upgrading/version-16), and [installation requirements](https://nextjs.org/docs/app/getting-started/installation) before upgrading.\n\n## 3. The App Router mental model\n\nThink of `app/` as both a URL tree and a React tree:\n\n```text\napp/\n├── layout.tsx              # shell shared by the route subtree\n├── page.tsx                # UI for the current route\n├── loading.tsx             # loading UI for the segment\n├── error.tsx               # segment error boundary (must be a Client Component)\n├── not-found.tsx           # segment-level 404\n├── blog/\n│   ├── layout.tsx\n│   ├── page.tsx            # /blog\n│   └── [slug]/\n│       └── page.tsx        # /blog/:slug\n└── api/\n    └── health/\n        └── route.ts        # HTTP endpoint, not a page\nproxy.ts                    # request interception at app level\n```\n\nRules an agent should apply:\n\n- A normal folder becomes a route segment when it contains an accessible `page.tsx` or `route.ts`.\n- `layout.tsx` wraps its children and can preserve state and navigation across transitions in its subtree.\n- `page.tsx` is the public UI for a route.\n- `route.ts` is a Web Request handler; a segment cannot have both `page.tsx` and `route.ts` at the same level.\n- `(group)` is a route group that organizes files without adding a URL segment.\n- `[slug]` is a single dynamic segment, `[...path]` is a catch-all, and `[[...path]]` is an optional catch-all.\n- `loading.tsx`, `error.tsx`, `not-found.tsx`, `sitemap.ts`, `robots.ts`, and `opengraph-image.tsx` are framework file conventions, not arbitrary filenames.\n- `public/` serves static files; never put secrets or private artifacts there.\n\nSee [Project structure](https://nextjs.org/docs/app/getting-started/project-structure), [Layouts and pages](https://nextjs.org/docs/app/getting-started/layouts-and-pages), [Dynamic segments](https://nextjs.org/docs/app/api-reference/file-conventions/dynamic-routes), and [File-system conventions](https://nextjs.org/docs/app/api-reference/file-conventions).\n\n### Dynamic page example for Next.js 16\n\n```tsx\ntype Props = {\n  params: Promise<{ slug: string }>\n  searchParams: Promise<{ preview?: string | string[] }>\n}\n\nexport default async function Page({ params, searchParams }: Props) {\n  const { slug } = await params\n  const query = await searchParams\n\n  return <Article slug={slug} preview={query.preview === \"1\"} />\n}\n```\n\nDo not write `params.slug` or `searchParams.q` without awaiting the promise in this version. When a path is known to Next.js type generation, use the generated helper when appropriate, for example `PageProps<'/blog/[slug]'>`.\n\n## 4. Server Components and Client Components\n\nApp Router uses Server Components by default. Keep a component on the server until it genuinely needs a browser API, state, effects, event handlers, or an interactive library.\n\n### Server Components are good for\n\n- Querying a database or calling a service that uses secrets.\n- Reading `params`, `searchParams`, headers, and cookies in a server boundary.\n- Reducing JavaScript sent to the browser.\n- Rendering content, metadata, and layouts that do not need interaction.\n\n### Client Components are good for\n\n- `useState`, `useReducer`, and `useEffect`.\n- `onClick`, `onChange`, drag-and-drop, and browser APIs.\n- Interactive editors, comboboxes, tabs, modals, and optimistic UI.\n\nPut `'use client'` on the smallest interactive leaf. Do not add it to a whole layout or page automatically: the directive creates a client boundary and increases the code sent to the browser.\n\n```tsx\n// app/posts/[slug]/page.tsx — Server Component by default\nimport LikeButton from \"./like-button\"\n\nexport default async function Page({ params }: { params: Promise<{ slug: string }> }) {\n  const { slug } = await params\n  const post = await getPost(slug) // server-only data access\n\n  return (\n    <article>\n      <h1>{post.title}</h1>\n      <LikeButton postId={post.id} />\n    </article>\n  )\n}\n```\n\n```tsx\n// app/posts/[slug]/like-button.tsx — small Client Component leaf\n\"use client\"\n\nexport default function LikeButton({ postId }: { postId: number }) {\n  // Keep state and event handlers here instead of moving the whole page to the client.\n  return <button data-post-id={postId}>Like</button>\n}\n```\n\nNever pass a database client, secret, non-serializable function, or unnecessary object from server to client. Use a narrow DTO containing only the fields the UI needs, and mark server-only modules so an accidental import fails during the build.\n\nSee [Server and Client Components](https://nextjs.org/docs/app/getting-started/server-and-client-components) and [Client Components](https://nextjs.org/docs/app/building-your-application/rendering/client-components).\n\n## 5. Data fetching, rendering, and cache\n\nBefore writing a fetch or database query, answer four questions:\n\n1. Is this data shared by every user, or does it depend on a session or cookie?\n2. How long may the data be stale?\n3. Must a mutation be visible immediately after it completes?\n4. Which part should render at request time, and which part should be cached or prerendered?\n\n### Cache Components in Next.js 16\n\n`cacheComponents: true` is an opt-in configuration for Cache Components. Once enabled, cache intentionally with `'use cache'`, `cacheLife()`, and `cacheTag()`. Dynamic code that is not cached runs at request time and should have an appropriate `Suspense` or loading UI.\n\n```ts\n// next.config.ts\nimport type { NextConfig } from \"next\"\n\nconst nextConfig: NextConfig = {\n  cacheComponents: true,\n}\n\nexport default nextConfig\n```\n\n```ts\nimport { cacheLife, cacheTag } from \"next/cache\"\n\nexport async function getPublicPost(slug: string) {\n  \"use cache\"\n  cacheLife(\"hours\")\n  cacheTag(`post:${slug}`)\n\n  return db.post.findUnique({ where: { slug } })\n}\n```\n\nDo not put user-specific values such as cookies or sessions into shared cache. Choose between public, remote/shared, and private/user cache deliberately, and verify the deployment adapter before assuming cache survives across instances.\n\n### Invalidation after a mutation\n\n- `cacheTag()` associates a cached query with a tag.\n- `revalidateTag(tag, profile)` marks a tag stale and is appropriate for stale-while-revalidate behavior; the profile should express the intended cache lifetime.\n- `updateTag(tag)` is used in a Server Action when the same user must immediately read its own write.\n- `revalidatePath(path)` is useful when a specific route must be re-rendered; it is not a substitute for a complete cache model.\n- If Cache Components are not enabled, inspect the actual fetch and route configuration for the installed version instead of mixing mental models from older Next.js releases.\n\nExample mutation that must show a new item immediately:\n\n```ts\n\"use server\"\n\nimport { updateTag } from \"next/cache\"\n\nexport async function createPost(input: FormData) {\n  await requireOwner()\n  const title = readAndValidateTitle(input)\n  const post = await db.post.create({ data: { title } })\n\n  updateTag(\"posts\")\n  updateTag(`post:${post.slug}`)\n  return { id: post.id }\n}\n```\n\nDatabase caching belongs in a server-only module, and invalidation must be designed alongside the mutation rather than added after users report stale data.\n\nSee [Caching](https://nextjs.org/docs/app/building-your-application/caching), [`use cache`](https://nextjs.org/docs/app/api-reference/directives/use-cache), [Cache Components migration](https://nextjs.org/docs/app/guides/migrating-to-cache-components), [`cacheLife`](https://nextjs.org/docs/app/api-reference/functions/cacheLife), [`cacheTag`](https://nextjs.org/docs/app/api-reference/functions/cacheTag), [`revalidateTag`](https://nextjs.org/docs/app/api-reference/functions/revalidateTag), and [`updateTag`](https://nextjs.org/docs/app/api-reference/functions/updateTag).\n\n## 6. Server Actions and Route Handlers are different boundaries\n\n### Server Actions\n\nUse Server Actions for mutations initiated by UI, such as create, update, or publish forms. Place `'use server'` at the module or function boundary used by the repository. Even when invoked directly by a form, treat the action as a public callable endpoint:\n\n1. Check the session and authorization in every action.\n2. Validate and normalize input on the server; client validation is UX only.\n3. Apply CSRF and abuse protection required by the auth stack, and rate-limit sensitive work.\n4. Do not send stack traces, secrets, or raw database errors to the client.\n5. Make writes idempotent or protect retries with unique constraints.\n6. Revalidate paths/tags after a write and return serializable state or redirect deliberately.\n\n```ts\n\"use server\"\n\nexport async function saveDraft(formData: FormData) {\n  const session = await auth()\n  if (!session?.user) return { ok: false, message: \"Unauthorized\" }\n\n  const input = parseDraft(formData)\n  if (!input.ok) return input.error\n\n  const draft = await db.transaction(async (tx) => {\n    // Enforce authorization and invariants inside the appropriate transaction boundary.\n    return tx.draft.create({ data: input.value })\n  })\n\n  revalidatePath(\"/dashboard\")\n  return { ok: true, id: draft.id }\n}\n```\n\n### Route Handlers\n\nUse Route Handlers when the application needs an HTTP API such as a webhook, JSON/Markdown export, health check, integration endpoint, or an HTTP method that is not a form mutation. A Route Handler lives in `app/**/route.ts` and receives a Web `Request` and returns a `Response` or `NextResponse`.\n\n```ts\nexport async function GET(\n  request: Request,\n  segmentData: { params: Promise<{ slug: string }> },\n) {\n  const { slug } = await segmentData.params\n  const item = await getPublicItem(slug)\n\n  if (!item) return Response.json({ error: \"Not found\" }, { status: 404 })\n  return Response.json({ id: item.id, title: item.title })\n}\n```\n\nFor each Route Handler, define status codes, content type, cache policy, CORS, and error shape explicitly. Do not turn a Server Action into an accidental public API contract, and do not expose an internal database row when the client only needs a public DTO.\n\nSee [Server Actions and Mutations](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations), [Forms](https://nextjs.org/docs/app/guides/forms), and [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers).\n\n## 7. `proxy.ts`: request interception, not the authorization layer\n\nIn Next.js 16, use `proxy.ts` for logic that must intercept a request before rendering, such as rewrites, redirects, locale routing, request headers, or a coarse authentication redirect.\n\n```ts\nimport { NextResponse, type NextRequest } from \"next/server\"\n\nexport function proxy(request: NextRequest) {\n  const hasSessionCookie = Boolean(request.cookies.get(\"session\"))\n\n  if (!hasSessionCookie && request.nextUrl.pathname.startsWith(\"/dashboard\")) {\n    return NextResponse.redirect(new URL(\"/auth/signin\", request.url))\n  }\n\n  return NextResponse.next()\n}\n\nexport const config = {\n  matcher: [\"/dashboard/:path*\"],\n}\n```\n\nWarnings:\n\n- Keep matchers narrow and test them; do not intercept every URL by default.\n- Cookie presence is only a signal. Enforce real session, ownership, and role checks in the Server Action or data layer.\n- Avoid expensive database work in the proxy.\n- Check runtime compatibility for every imported package because the Next.js 16 proxy convention uses the Node.js runtime.\n- When renaming `middleware.ts`, check matchers, imports, tests, and deployment behavior together.\n\nSee [Proxy](https://nextjs.org/docs/app/api-reference/file-conventions/proxy) and [Redirecting](https://nextjs.org/docs/app/building-your-application/routing/redirecting).\n\n## 8. Environment variables and security\n\nRules an agent should remember:\n\n- Treat variables without `NEXT_PUBLIC_` as server-only; never import them into a Client Component.\n- `NEXT_PUBLIC_*` values are inlined into the client bundle at build time. They are not secrets, and the value can be frozen to the environment used for the build.\n- Keep production secrets in the platform's environment-variable or secret manager, not in git.\n- Set environment variables before the build when they must be bundled, and verify runtime variables separately for server code.\n- Never print `DATABASE_URL`, OAuth secrets, `AUTH_SECRET`, cookie secrets, or tokens in logs, reports, or stack traces.\n- Validate environment variables at startup or the first server boundary with a clear schema and a non-secret error message.\n- Public origin, OAuth callback URL, canonical URL, and trusted-host settings must agree across the app, provider, and reverse proxy.\n\nExample server-only environment access:\n\n```ts\nimport \"server-only\"\n\nexport function databaseUrl() {\n  const value = process.env.DATABASE_URL\n  if (!value) throw new Error(\"DATABASE_URL is not configured\")\n  return value\n}\n```\n\nWith a reverse proxy or CDN, verify the protocol seen by the application, trusted host behavior, forwarded headers, `Secure` cookies, OAuth callback URL, and canonical origin together. Do not fix one redirect URL while leaving the other boundaries inconsistent.\n\nSee [Environment Variables](https://nextjs.org/docs/app/guides/environment-variables), [Authentication](https://nextjs.org/docs/app/guides/authentication), and [Data Security](https://nextjs.org/docs/app/guides/data-security).\n\n## 9. SEO, metadata, and agent-readable content\n\nFor a public knowledge site, separate three representations:\n\n1. HTML for people and search engines.\n2. Metadata, sitemap, and robots files for discovery.\n3. JSON and Markdown endpoints for agents and integrations that need a stable contract.\n\nUse the Metadata API or Next.js metadata file conventions:\n\n```ts\nimport type { Metadata } from \"next\"\n\nexport const metadata: Metadata = {\n  title: \"Article title\",\n  description: \"Short, accurate description\",\n  alternates: { canonical: \"https://example.com/content/article\" },\n}\n```\n\nPrinciples for an agent-readable endpoint:\n\n- The canonical URL must be stable and must not change because of unrelated query parameters.\n- JSON should include an identifier, type/version, status, timestamps, and a complete `body`.\n- Markdown should include parseable metadata such as `slug`, `type`, `revision`, `published_at`, and `updated_at`.\n- A missing resource must return a real 404, not a 200 response with an empty body.\n- Never expose drafts, archived content, internal IDs, or owner-only fields through public endpoints.\n- Add fields backward-compatibly; if a meaning changes, add a contract version or migration note.\n\nSee [Metadata](https://nextjs.org/docs/app/getting-started/metadata-and-og-images), [Sitemap](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap), [Robots](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots), and [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers).\n\n## 10. Images, fonts, and external origins\n\n- Use `next/image` when sizing, optimization, and lazy loading are useful.\n- Allowlist remote images with the narrowest practical `images.remotePatterns`.\n- Do not use `images.domains` for new work; it is a legacy configuration.\n- Use `next/font` for controlled font loading and lower layout shift.\n- Verify CSP, image hosts, preload behavior, and cache headers after deployment rather than trusting only the development server.\n\n```ts\n// next.config.ts\nconst nextConfig = {\n  images: {\n    remotePatterns: [\n      {\n        protocol: \"https\",\n        hostname: \"images.example.com\",\n        pathname: \"/assets/**\",\n      },\n    ],\n  },\n}\n\nexport default nextConfig\n```\n\nSee [Image Optimization](https://nextjs.org/docs/app/getting-started/images), [Image component](https://nextjs.org/docs/app/api-reference/components/image), and [Font Optimization](https://nextjs.org/docs/app/getting-started/fonts).\n\n## 11. Testing and production verification\n\n`next build` passing does not prove that authentication, OAuth callbacks, cache invalidation, DNS, TLS, or database migrations work in production. Verify each layer:\n\n### Static checks\n\n```bash\nnpm run typecheck\nnpm run lint\nnpm run build\n```\n\nIf a script does not exist, inspect `package.json` and the real project configuration before inventing a command. In Next.js 16, do not use `next lint` by default; use the repository's ESLint or Biome command.\n\n### Behavior checks\n\n- An anonymous user can open public pages.\n- Protected routes redirect to the correct origin without a loop.\n- Invalid input returns a predictable error shape.\n- A missing resource returns 404.\n- A mutation writes data and reads it back according to the cache policy.\n- Public endpoints do not return secrets, drafts, or internal-only fields.\n- A dynamic route with `[slug]` awaits `params`.\n- The production server starts after the build with the same environment model used in deployment.\n\n### External checks\n\n- Check the public domain, content URL, JSON representation, and Markdown representation.\n- Check the TLS certificate and reverse-proxy mode.\n- Check the OAuth callback URL as an exact string.\n- Check database migrations and SSL connections.\n- Check logs without exposing secrets.\n\nUse the repository's E2E tool, such as Playwright or Cypress, for browser behavior. Keep unit and integration tests focused on data access, action validation, route status, and public contracts.\n\nSee [Testing](https://nextjs.org/docs/app/guides/testing), [Production Checklist](https://nextjs.org/docs/app/guides/production-checklist), and [Deploying](https://nextjs.org/docs/app/getting-started/deploying).\n\n## 12. Deployment checklist for Heroku or Node hosting\n\n1. Keep the lockfile in the repository so the build uses reproducible dependency versions.\n2. Use Node `20.9+` and keep the version consistent across local, CI, and Heroku.\n3. Set runtime secrets before start and public environment values before build when they must be bundled.\n4. Use `next build` through the project's build script.\n5. Use `next start` or the server command defined by the repository.\n6. Run database migrations as a release step separate from app start, and make retries safe.\n7. Use the platform-provided `PORT`; never hardcode an internal port or mistake a dyno port in logs for a public URL.\n8. Align the canonical origin, OAuth callback, trusted host, and proxy headers with the custom HTTPS domain.\n9. Enable SSL for a managed Postgres provider and test the connection from the real runtime.\n10. After deployment, check health, public pages, authentication, database write/read behavior, logs, and the rollback path.\n\nFor this repository, the known commands are `npm run build`, `npm run start`, `npm run lint`, `npm run typecheck`, `npm run db:generate`, `npm run db:migrate`, and `npm run db:seed`. Do not run the seed script in production unless the task explicitly requires it: a seed can create real sample data.\n\n## 13. Migration checklist from older Next.js versions to 16\n\nWhen an agent finds older code, search for the complete group rather than fixing only the first error:\n\n- `params.` and `searchParams.` in pages, layouts, metadata, and route handlers: convert the types to promises and `await` them.\n- `middleware.ts`: evaluate the move to `proxy.ts`, then check matchers and runtime behavior.\n- `next lint`: replace it with the repository's ESLint or Biome command.\n- `revalidateTag(`: inspect the signature and provide the correct profile or use the API whose semantics match the requirement.\n- `images.domains`: replace it with `remotePatterns`.\n- Parallel route slots: add `default.js` when a slot may not match.\n- `experimental.ppr` and older cache patterns: read the Cache Components migration guide before changing configuration.\n- APIs that were synchronous in older versions, including `cookies()`, `headers()`, and `draftMode()`: check the version migration and await the current API.\n- Custom servers and adapters: verify Node runtime, build output, and deployment contracts.\n\nDo not perform a global search-and-replace migration without typechecking and building. Some occurrences may be helpers with different types or library boundaries.\n\n## 14. Recommended agent workflow for a new task\n\n### Before editing\n\n```text\nObserved:\n- package version, route path, current schema, existing scripts\n\nInferred:\n- intended behavior from nearby code and official documentation\n\nUnknown:\n- missing acceptance criteria, provider behavior, deployment setting\n\nPlan:\n- smallest files and verification checks needed\n```\n\nRead sources of truth in this order: `AGENTS.md` → requirement/spec/task → package/config → relevant code → version-matched official docs → tests.\n\n### While editing\n\n- Preserve the Server/Client boundary.\n- Do not add a dependency when an existing dependency or standard API is sufficient.\n- Validate at the server boundary.\n- Use types that express the contract instead of `any`.\n- Keep cache policy and invalidation close to the query and mutation.\n- Never log secrets or copy production data into fixtures.\n- When changing a public contract, update its types, implementation, tests, and docs together.\n\n### Before reporting completion\n\nReport at least:\n\n- Files changed and why.\n- Commands actually run and their results.\n- URLs or APIs smoke-tested.\n- Migrations or environment changes the user must perform.\n- Known limitations or `Unknown` items that could not be verified.\n\n## 15. Research source map\n\nPrimary sources used for this guide are official Next.js/Vercel documentation and repository documentation:\n\n- [Next.js App Router docs](https://nextjs.org/docs/app)\n- [AI Coding Agents](https://nextjs.org/docs/app/guides/ai-agents)\n- [Next.js 16 release](https://nextjs.org/blog/next-16)\n- [Next.js 16 upgrade guide](https://nextjs.org/docs/app/guides/upgrading/version-16)\n- [Installation and system requirements](https://nextjs.org/docs/app/getting-started/installation)\n- [Project structure](https://nextjs.org/docs/app/getting-started/project-structure)\n- [Layouts and pages](https://nextjs.org/docs/app/getting-started/layouts-and-pages)\n- [Dynamic route segments](https://nextjs.org/docs/app/api-reference/file-conventions/dynamic-routes)\n- [Server and Client Components](https://nextjs.org/docs/app/getting-started/server-and-client-components)\n- [Caching](https://nextjs.org/docs/app/building-your-application/caching)\n- [`use cache`](https://nextjs.org/docs/app/api-reference/directives/use-cache)\n- [Cache Components migration](https://nextjs.org/docs/app/guides/migrating-to-cache-components)\n- [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers)\n- [Server Actions and Mutations](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations)\n- [Proxy file convention](https://nextjs.org/docs/app/api-reference/file-conventions/proxy)\n- [Environment variables](https://nextjs.org/docs/app/guides/environment-variables)\n- [Authentication](https://nextjs.org/docs/app/guides/authentication)\n- [Data security](https://nextjs.org/docs/app/guides/data-security)\n- [Metadata and OG images](https://nextjs.org/docs/app/getting-started/metadata-and-og-images)\n- [Testing](https://nextjs.org/docs/app/guides/testing)\n- [Production checklist](https://nextjs.org/docs/app/guides/production-checklist)\n- [Deploying](https://nextjs.org/docs/app/getting-started/deploying)\n\nStatements using “should”, “recommended”, or “do not” are engineering recommendations synthesized from the official documentation and this repository's context; they are not all hard requirements of the Next.js API.\n"}