Nextjs 14.Selection of server page redirection and client page redirection

13 views Asked by At

Big shot, can I ask you a question? Do you have any good suggestions I need to redirect the page based on interface data during page refresh, and clicking on the redirect route by the user will not trigger the redirect

I have tried the following two methods
**1.When using Router push on the client side, it is found that for example, when accessing page A, page B will first appear after loading, and there will be a brief flashing sensation

2.In the server-side implementation of middleware.js, there is no problem with page flicker, but every time it waits for an interface response, it loses the advantage of SSR.**

0

There are 0 answers