Next.js Discord

Discord Forum

Fetch revalidate always skipped

Answered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
Hi all,

I have simple function inside server component, this function fetches from local api route.

Anytime I visit page where component function is called, i always see cache: skip

When trying to build, fetch fails. I need to try set this component function to cache the response from local API every 3-4 mins, any help appreciated.
Answered by not-milo.tsx
Well first you shouldn't fetch your own api routes. Since RSCs came out you can fetch data from you db/external service directly in them.

And also there's not enough information to help you. Provide relevant code snippets and some more details about the project structure.
View full answer

14 Replies

Northeast Congo LionOP
Cache missed reason: (cache-control: no-cache (hard refresh))
Well first you shouldn't fetch your own api routes. Since RSCs came out you can fetch data from you db/external service directly in them.

And also there's not enough information to help you. Provide relevant code snippets and some more details about the project structure.
Answer
Ahaha, it happens. So you solved it?
@not-milo.tsx Ahaha, it happens. So you solved it?
Northeast Congo LionOP
Yeah im gonna close this actually, had another related issue but its cool
thanks for ur help 🙂
I actually cant close this forum, it says No Commands
You can only mark an answer as solution. If you don't see the option it might be just Discord bugging out, restart the app and try again.
Northeast Congo LionOP
yh discord bugging fr, restarted
eey got it
:success:
Northeast Congo LionOP
have just opened a new issue, wonder if i could get ur thoughts on that
i've never seen this issue on nextjs before