You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How do I get getServerSideProps to work with Apollo cache?
#28253
What I want is that when I navigate to a page for the first time, it will make a server request for the .json data as it should, but if I navigate to another page and then go back, it shouldn't make a server request since this data should be on the browser cache. This happens on NextJS official site or for example on https://jobs.netflix.com/.
I don't understand what I haven't done in order for this cache to work.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
So, I've got a project which uses
getServerSidePropsonon each page. The Apollo client boilerplate is taken from the official apollo next js example (https://github.com/vercel/next.js/blob/canary/examples/with-apollo/lib/apolloClient.js).What I want is that when I navigate to a page for the first time, it will make a server request for the .json data as it should, but if I navigate to another page and then go back, it shouldn't make a server request since this data should be on the browser cache. This happens on NextJS official site or for example on https://jobs.netflix.com/.
I don't understand what I haven't done in order for this cache to work.
This is my _app.js:
I use
getInitialPropsonly for global data like header and footer data, then on pages, I usegetServerSideProps.All reactions