Next.js Discord

Discord Forum

How to combine ppr with dynamic route ?

Havana posted this in #help-forum
Open in Discord
Lets say, I have a dynamic product route where i am accepting the product [slug] and making request to the database. To reduce the database call i wanna make the content related to product static and other content related to user dynamic.

But as i access the cookie in a nested component the whole route becomes dynamic and calls db on every visit even though i am using suspense to wrap that cookie accessing component. Is this expected behavior or i am missing something. I didn't find any example/doc with dynamic route.

Note: If i don't use cookie then the page is fully static without any config.

I am using ^14.0.4-canary.35 and also ppr enabled in config.

1 Reply

I have this exact same question. 🙋‍♂️