Technical Enhancements in Next.js 15

Search for a command to run...

No comments yet. Be the first to comment.
Bun, the hyper-fast JavaScript runtime known for its incredible speed and Zig-based architecture, is being completely rewritten in Rust. For a project that has over 22 million monthly downloads and ea

Next.js 16.3 is almost here, and it's packed with a ton of improvements and let's see them in this post 1.Instant Navigation For a while now, there’s been a valid, lingering debateServer Components vs

It’s official. React has merged its long-awaited Rust port of the React Compiler (formerly known as React Forget) into the main repository. What started as an experimental research project by Joseph S

If you follow modern technology trends, you have likely been led to believe that artificial intelligence is entirely built on Python. Every tutorial, machine learning framework documentation, and open

Just when the JavaScript ecosystem was catching its breath after last week’s TanStack Router compromise, the Mini Shai-Hulud supply chain worm has continued its relentless march. Developed by the thre

Next.js 15 comes with significant technical advancements, particularly in caching and routing.
One of the major changes is the shift from caching GET Route Handlers by default to making them uncached unless explicitly opted-in by developers. This is a huge step towards providing more precise control over caching for improved performance, especially for applications relying heavily on external APIs or dynamic data.
In Next 14, Route Handlers that used the GET HTTP method were cached by default unless they used a dynamic function or dynamic config option. In Next.js 15, GET functions are not cached by default.
You can still opt into caching using a static route config option such as export dynamic = 'force-static'
In Next.js 14.2.0, an experimental staleTimes flag to allow custom configuration of the Router Cache were introduced.
In Next.js 15, this flag still remains accessible, but the default behavior to have a staleTime of 0 for Page segments. This means that as you navigate around your app, the client will always reflect the latest data from the Page component(s) that become active as part of the navigation. However, there are still important behaviors that remain unchanged:
Shared layout data won't be refetched from the server to continue to support partial rendering.
Back/forward navigation will still restore from cache to ensure the browser can restore scroll position.
loading.js will remain cached for 5 minutes (or the value of the staleTimes.static configuration)
Developers can now choose to make routes static using configuration options like force-static, allowing for finer control over content delivery. Alongside this, the new after() API enables developers to schedule work after a response is streamed, ensuring that tasks such as logging and analytics do not impact the user experience.
To use it, add experimental.after to next.config.js
const nextConfig = {
experimental: {
after: true,
},
};
export default nextConfig;
Then, import the function in Server Components, Server Actions, Route Handlers, or Middleware.
import { unstable_after as after } from 'next/server';
import { log } from '@/app/utils';
export default function Layout({ children }) {
// Secondary task
after(() => {
log();
});
// Primary task
return <>{children}</>;
}
Next.js 15 brings improved error messages for easier debugging.Hydration errors now display the source code of the error with suggestions on how to address the issue.

The new version fully supports ESLint 9, helping developers maintain code quality while making migration from older versions smoother.
To ensure a smooth transition, Next.js remain backwards compatible, meaning you can continue using either ESLint 8 or 9.
If you upgrade to ESLint 9, and if you haven't yet adopted the new config format, Next.js will automatically apply the ESLINT_USE_FLAT_CONFIG=false escape hatch to ease migration.
Additionally, deprecated options like —ext and —ignore-path will be removed when running next lint.
Next.js 15’s technical innovations, from enhanced caching control to powerful new APIs like after(), provide developers with the flexibility and performance optimizations necessary for modern web applications. These changes allow for smarter, faster, and more reliable applications, making Next.js 15 a future-proof choice for developers.