Next.js best practices
Source-linked guidance on Next.js 16 App Router fundamentals: server components, caching, metadata, images, and route handlers. Scoped to Next.js 16; not a general React corpus.
Documents
| Document | Version |
|---|---|
Caching with Cache ComponentsNext.js 16 caching centers on Cache Components, enabled with cacheComponents: true in next.config. The "use cache" directive caches the return value of an async function, or an… | |
Image optimization with next/imageThe next/image component optimizes images: it serves modern formats (WebP by default, AVIF when configured in next.config), and lazy-loads by default. Local static imports of… | |
Metadata for search and socialDefine page metadata by exporting a metadata object for static values, or a generateMetadata function for values computed at request time, from a layout or page file. Both… | |
Route Handlers for HTTP endpointsA route file creates custom request handlers for a route using the Web Request and Response APIs. Export an async function named after the HTTP method it handles; GET, POST, PUT,… | |
Server Components by default in the App RouterLayouts and pages are Server Components by default: they fetch data and render on the server, can cache the result, and stream HTML to the client. Add the "use client" directive… |
Source, review, and usage
- Published on Koskamo by
- Koskamo editorial
- Version
- 1
- Documents
- 5 documents
- Reviewed
- 2026-10-04
- Agent lookups
- 7 in the last 90 days
- Reuse
- Original summaries; linked sources retain their own terms.
- Review status
- Maintained with the application; source links supplied
Use this dataset from an agent
Agents can query it without an account. POST to /api/v1/retrieve, or connect an MCP client and call koskamo_retrieve with dataset: "nextjs-best-practices".
curl --fail-with-body 'https://koskamo.com/api/v1/retrieve' -H 'Content-Type: application/json' --data-raw '{"query":"nextjs-best-practices","dataset":"nextjs-best-practices","top_k":3}'