Allow bypass "getData" of page component on client side navigation
See original GitHub issueFeature request
Is your feature request related to a problem? Please describe.
@aralroca shared some useful insights on how he archived his app performance.
Using SPA navigation (clicking a Link or Router.push) the page is rendered after getInitialProps or getServerSideProps is resolved.
However, with getInitialProps you can “skip” fetching the data to don’t block the navigation. So you can render the new page with skeletons just at the same moment that you clicked the Link.
With this, I’m using getInitialProps only for real SSR and not for client navigation. Doing the fetch navigation on a useEffect.
But getServerSideProps is not possible (or at least I dunno how to handle this) to do the same behavior.
He still relies on getInitialProps instead getServerSideProps because it allows him to skip client-side data fetching on route change. He loads the data on the next useEffect(..., []) lifecycle. SSR is not affected. In that scenario, he can ship the app skeleton faster to the user and load the data afterward on the client.
This sounds reasonable when your static content dominate the page which is often the case.
Describe the solution you’d like
export const config = {
clientDataFetch: false
}
export async function getServerSideProps(){
return {
props: await fetchProps()
}
}
Working PR which demonstrates the behavior by defining skipDataFetch on Link component. https://github.com/StarpTech/next.js/tree/add/skip_data_fetch
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Reactions:25
- Comments:26 (15 by maintainers)

Top Related StackOverflow Question
has there been any progress on this? Im using getServerSideProps for seo reasons to provide the initial data for some pages, then caching it (using apollo). However when navigating back to the same page (data is already cached) its re-running the getServerSideProps and blocking the navigation until that resolves.
The data fetching in the getServerSideProps isn’t super slow, but the process of calling the getServerSideProps is very slow and this leads to a very slow navigation to pages that contain getServerSideProps.
Am I missing something here?
Thanks
Any activity on this? It’s really annoying problem! Very common plugins (next-i18next, next-translate) are already dropped support for
getInitialProps. All new examples are usinggetServerSidePropsas preffered solution and there is NO WAY to eliminate extra network call every time route changed? Nobody uses client-side cache? Hmm… don’t believe it. Waiting for experimental react feature is not a solution for now.You really need to think about it. I don’t understand why this issue takes so little attention from community…