Next.js Discord

Discord Forum

Caching on server and caching on client

Unanswered
Jack Snipe posted this in #help-forum
Open in Discord
Jack SnipeOP
Hi guys, I need your little help on explaing the cache function of nextjs

1. So I used fetch to call api, and pass it down to the page. The problem is seem like it is the client cache, not the server cache, right? because when i change the browser, or machine, the time will be 1-2 seconds again, the I refresh the page and try to redirect, it's cached with 0.5 second
So the fetch(DOMAIN) is the client cache, right?
For more information, I used the newest nextjs version, with app router. 😄

2. If I used cache from 'react', does it make the cache on server side?

https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#example

12 Replies

Jack SnipeOP
I dont have the route.js file
Only page.jsx
@Polish Hound are you use app router?
Jack SnipeOP
Does that effect?
Polish Hound
hmm i can i have your code?
where yor api hits
@Polish Hound hmm i can i have your code?
Jack SnipeOP
Sure, but it about 2h more, is that okay?
Or 1hour more and I may can share your code
😄
Polish Hound
ok