Next.js 16.4 introduces lazy compilation, smaller Turbopack output, React 19.3 features, Cache Components improvements, and new developer tooling.
Published By From Next.js Blog · 1 min read
WebNext.js 16.4
Over the 16.x releases, we’ve introduced a new programming model that addresses many of the frustrations you've had with App Router from the start:
This new programming model is called Cache Components, and it will become the default in Next.js 17.
Prior to this release, we didn’t recommend it universally because there were some cases where it couldn’t achieve the same cost and performance guarantees as with the previous model.
This release includes key features that close those gaps.
Starting with Next.js 16.4, we’re excited to recommend Cache Components as the best choice for every Next.js app.
As of today, all new apps created with create-next-app will have Cache Components enabled by default.
This is an excerpt. The full article is published by Next.js Blog.
Answers to common questions regarding this article's topic, architecture, and practical applications.
Cache Components are a suite of features that lets you mark specific parts of your component tree as eligible for caching. Think of 'use cache' as a component-level version of the Cache-Control HTTP header: import { cacheLife } from 'next/cache';
export default async function DashboardPage() {
const currentUser = await getCurrentUser();
return (
<div>
<p>Welcome, {currentUser.name}</p>
<Suspense fallback={<Loading />}>
General
Over the 16.x releases, we’ve introduced a new programming model that addresses many of the frustrations you've had with App Router from the start:
How It Works
In this post, we use "Cache Components" to refer to the new programming model, which you can use today by enabling two flags in your Next.js config: import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
cacheComponents: true,
partialPrefetching: true,
};
export default nextConfig;
Cache Components first shipped without Partial Prefetching, but it's now considered part of the model. You can learn more about Partial Prefe
How It Works
Prefetching is a powerful way to improve the UX of your Next.js applications. By using <Link prefetch> or useRouter().prefetch(), you can eliminate loading states by prerendering a page's cached UI before an actual navigation takes place. For example, let's look at a simple email app. Here's an Inbox that renders links to each message: async function Inbox() {
const messages = await db.query.messages.findMany();
return (
<nav>
{me
General
We're investing in agent tooling to make Next.js a system that continuously helps keep your app secure and up to date. Next.js 16.4 builds on our documentation, Skills, and verification tools with agent upgrades and feedback, helping us learn from how you build and bring improvements back to your app.