Next.js Discord

Discord Forum

Revalidation of path not work.

Answered
Tree Pipit posted this in #help-forum
Open in Discord
Tree PipitOP
My nextjs 14 application stopped revaildating completely. It was working fine in previously but then it stopped working out of no where. I am using revalidatePath and here is how my code looks.

What I want to achive. I want to refetch the data when ever an user adds new data to the table.
Answered by Tree Pipit
Lmao I'm just stupid. I wanted to implement global search. So I used useState to store the query result. The default value being the intial data from the server.
View full answer

35 Replies

Tree PipitOP
Alright will try
Tree PipitOP
AHHH I THINK IK WHY IT'S NOT WORKING
why?
oh btw
axios arent cached
Tree PipitOP
Lmao I'm just stupid. I wanted to implement global search. So I used useState to store the query result. The default value being the intial data from the server.
Answer
@ᴉuɐpɹɐɐ axios arent cached
Tree PipitOP
As in?
What exactly does caching do?
I had gone through this
i mean if you are using revalidatePath that means you need something that is cached
or else what will it revalidate?
Tree PipitOP
Oh
so wait
router.refresh
is the one that is doing the magic
I feel dumb
xd
so i was wondering, what doesnt work?
Tree PipitOP
hahaha,

what would you suggest when fetching data
Axios or fetch?
Or something else
fetch is better for new projects
https://www.adios-axios.com/#why
Tree PipitOP
Does caching make things feel fast
?
yeah
Tree PipitOP
Sounds good
is the problem fixed?
we can talk more in #off-topic if its not about troubleshooting
Tree PipitOP
Yes, but the fix is now caused an another problem. I have to find a new way to implement global search
ahh feel free to create a new help forum if you need troubleshooting
Tree PipitOP
One sec
Cool
How do I close this one?
No need to close it, you can mark it as answered by right clicking message