question about ppr in nextjs15
Unanswered
Asiatic Lion posted this in #help-forum
Asiatic LionOP
When a page(that uses ppr) link apears on the screen, it will prefetch the entire page before i click, does this also prefetch the components wrapped in suspense?
bonus question:
I only have a DB call in the component wrapped with suspense, does this make the component static?, if i bring await headers it will show the skeleton for this component every time i visit the page and it's annoying
thanks !
bonus question:
I only have a DB call in the component wrapped with suspense, does this make the component static?, if i bring await headers it will show the skeleton for this component every time i visit the page and it's annoying
thanks !
4 Replies
@Asiatic Lion When a page(that uses ppr) link apears on the screen, it will prefetch the entire page before i click, does this also prefetch the components wrapped in suspense?
bonus question:
I only have a DB call in the component wrapped with suspense, does this make the component static?, if i bring await headers it will show the skeleton for this component every time i visit the page and it's annoying
thanks !
Headers, cookies, and searchparams are dynamic data and you cannot turn that into static. So in every request those gonna be rendered in the server . With suspense that part will be streamed and you will see fallback of suspense evrytime. In Next 16 with cache components there is some features to kinda try to cache some dynamic parts but those will remain out of the static shell, I don't have a full understanding of those so take this with a grain of salt. Also i think PPR in 15 was experimental (dynamic IO) not sure how this works but wasn't suppose to be used for production.
ok do the db fetch would be dynamic and I went to the docs on pre fetching and set iit to 15......
it says Partial Prerendering (PPR)
When PPR is enabled, a page is divided into a static shell and a streamed dynamic section:
The shell, which can be prefetched, streams immediately
Dynamic data streams when ready
Data invalidations (revalidateTag, revalidatePath) silently refresh associated prefetches
When PPR is enabled, a page is divided into a static shell and a streamed dynamic section:
The shell, which can be prefetched, streams immediately
Dynamic data streams when ready
Data invalidations (revalidateTag, revalidatePath) silently refresh associated prefetches
so what I understand from that is the static shell will be prefetched and the dynamic part will eventually @Nuitari @Asiatic Lion