SSG and SSR mix
Answered
American black bear posted this in #help-forum
American black bearOP
Hey guys, anybody has an idea for the following problem?
https://github.com/vercel/next.js/discussions/54662
https://github.com/vercel/next.js/discussions/54662
Answered by fuma
Actually, it's not yet supported to have both dynamic rendering/static rendering for a page
You may consider using client-side solutions to get user info
You may consider using client-side solutions to get user info
8 Replies
Actually, it's not yet supported to have both dynamic rendering/static rendering for a page
You may consider using client-side solutions to get user info
You may consider using client-side solutions to get user info
Answer
@American black bear Hey guys, anybody has an idea for the following problem?
https://github.com/vercel/next.js/discussions/54662
You have to maybe use force-cache for the fetch in your page
If you don’t use fetch, you probably have to use unstable_cache (no idk how to use it)
When they finally support different dynamicality of layouts and pages in a route, then the workaround above is no longer necessary, but we are not there yet
American black bearOP
Alright - good to know. Thank you 🙂
Btw. I actually think that would be like a super cool feature and from what I've tried so far, the only problem is that dynamic values?(headers, cookies) are not set in the dynamic layout (if you use force-dynamic and force-static in combination)
We do it @ https://embaas.io and it would be nice to be able to show the user that they are logged in at all times. I will try moving away from force-static, but it's just 10x faster.
We do it @ https://embaas.io and it would be nice to be able to show the user that they are logged in at all times. I will try moving away from force-static, but it's just 10x faster.
That's the reason I currently recommend doing that client side (with libraries like SWR), as a workaround before they finally support it
American black bearOP
Yeah ..