About refetch in parallel routes #60279
Unanswered
SeokJunYeom
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
There was an inconvenience while using parallel routes. First, let me explain my use case: I am prefetching the API with server actions in a slot and hydrating it to the client side. The problem is that as many client requests are generated as there are slots, N slots are executed N times, that is, O(N²). I found that cache was being refetched when the
PrefetchKindisauto, and the navigation reducer generates as many segment paths as parallel routes and generatesfetchResponsein a loop. I solved this problem with<Link prefetch={true}>in production, but in development, I couldn't find a way to avoid thePrefetchCacheEntryStatus.stalestate, so the speed of my local development environment is not good. Am I not using parallel routes as intended?Additional information
The link below is to a post in the help forum in the next.js discord that talks about this. https://discord.com/channels/752553802359505017/1192141030359826493
Example
No response
All reactions