Files
Jiachi LiuandGitHub d5f596ed7b [metadata] only blocking render for html bots in ppr pages (#76379)
### What

In non-PRR mode, we keep the original behavior that metadata is blocking but stream the rest. Previously we also do the full dynamic rendering for both non-PPR and PPR pages, which is required for PPR pages to discard the postpone cache but not necessary for non-PPR pages.

This PR align the behavior as before.

Closes NDX-881
2025-02-23 17:09:18 +01:00

36 lines
836 B
TypeScript

import { connection } from 'next/server'
/// Page is suspended and being caught by the layout Suspense boundary
export default function Page() {
return (
<div className="container">
<SuspendedComponent />
</div>
)
}
async function SuspendedComponent() {
await connection()
await new Promise((resolve) => setTimeout(resolve, 500))
return (
<div>
<div>outer suspended component</div>
<NestedSuspendedComponent />
</div>
)
}
async function NestedSuspendedComponent() {
await connection()
await new Promise((resolve) => setTimeout(resolve, 500))
return <div>nested suspended component</div>
}
export async function generateMetadata() {
// Slow but static metadata
await new Promise((resolve) => setTimeout(resolve, 2 * 1000))
return {
title: 'dynamic-page - partial',
}
}