Next.js
/Advanced
Partial Prerendering (PPR)
Definition
An experimental Next.js architecture that combines the ultra-fast instant loading of Static Site Generation (SSG) with fully dynamic Server-Side Rendering (SSR) on the exact same page.
Explain Like I'm New
Historically, a page had to be 100% Static or 100% Dynamic. If you added a dynamic 'Shopping Cart' icon to a static 'Blog', the whole page became slow. PPR fixes this. The server instantly sends a static HTML shell (the blog), leaving a 'hole' for the shopping cart, which is streamed in dynamically milliseconds later.
Real World Example
An E-commerce product page. The product image, title, and description are served instantly as a static cache. The 'Add to Cart' button (which needs to check live inventory) is dynamically rendered and popped into the page.
Common Use Cases
- •E-commerce
- •Personalized static pages
Interactive Example
Loading Code Playground...
Interview Questions
basic
- In Partial Prerendering, does the static shell of the page wait for the dynamic parts to finish loading?
intermediate
- How do you define the 'boundary' between the static shell and the dynamic content in PPR?