Next.js continues to evolve as a go-to React framework for developers, and version 15 is packed with innovative features that enhance performance and improve development workflows. This release has made updates across server-side rendering, caching, and more, building on the solid foundation of Next.js 14. Here's a breakdown of what's new in Next.js 15 and how these changes can impact your projects.
1. Enhanced Async Request APIs
One of the major updates in Next.js 15 is the move to asynchronous access for server-side requests. Traditionally, data like cookies, headers, and params were fetched synchronously. Now, these can be accessed asynchronously, which improves server performance by separating data fetching from rendering. Here's an example:
This update lets pages render without waiting for all server data to be fetched, potentially leading to faster load times.
2. Revamped Caching Model
Caching has been rethought in Next.js 15. Unlike previous versions where caching was default for fetch requests and GET route handlers, the new model requires developers to manually set caching rules. This change enables precise control over caching behavior:
This approach offers more flexibility and can be optimized for specific use cases, but be aware that existing code might need updating to accommodate these changes.
3. Compatibility with React 19
Next.js 15 introduces support for the React 19 release candidate, aligning with the latest React features, especially within the App Router. This compatibility allows developers to take advantage of new optimizations React offers. However, for stability, the Pages Router still relies on React 18, which is a detail to keep in mind as React 19 remains experimental.
