9 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article explains Partial Prerendering (PPR) in Next.js, a method that combines static and dynamic rendering for better performance. It details how PPR optimizes page loading by serving static content immediately while fetching dynamic data in parallel, addressing the challenges faced in previous rendering methods.
If you do, here's more
Partial Prerendering (PPR) in Next.js enhances rendering speed by allowing static portions of a page to load quickly while still enabling dynamic server rendering for components that rely on request-specific data. This addresses a common challenge in web development: the trade-off between performance and full functionality. Static rendering is fast but lacks access to request data, while dynamic rendering is slower because it requires server-side processing. PPR optimizes this balance, enabling developers to maintain high performance even when their applications need to access dynamic content.
One of the core innovations in PPR is how it handles request data access. Initially, the mechanism relied on error throwing to signal when request data was accessed, which created issues for developers migrating existing applications. The new approach uses promises instead. This means that when request data is accessed during prerendering, the API returns a promise that never resolves, effectively suspending processing without throwing errors. This change streamlines the build process and minimizes delays caused by retry logic, which previously slowed down builds when errors occurred.
PPR also leverages the Node.js event loop to optimize how tasks are scheduled. By recognizing that non-deterministic I/O operations can't complete within the same task, Next.js can manage prerendering more effectively. It utilizes a scheduling mechanism that allows synchronous operations to finish while aborting any pending asynchronous I/O tasks. This careful orchestration results in improved performance metrics, particularly for Core Web Vitals like Time to First Byte (TTFB) and Largest Contentful Paint (LCP), with goals aimed at achieving sub-2.5-second LCP times. The final piece involves the prospective render strategy, which fetches external data during build time to ensure that cache entries are ready without holding up the prerendering process.
Questions about this article
No questions yet.