How to update current route data by using revalidate tag in the server action?? #67173
Unanswered
takakikasuga
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I update current data by revalidate tag
Now, I study app router and the next cahce like data cache and so on...
I try to do some option of fetch and revalidate tag and path.
today, I use revalidate tag in the server action, and I wanna update data of the tag and I don't expect to update data other than tag.
In this below video, I updated
layout tag
in the ActionLayout, but after revalidatelayout tag
, other tag data likepage tag
in the ActionPage androot tag
int the RootLayout was updated.I don't know this action happend...
additionally, after updated data related to all tags and reload the browser,
layout tag
was updated correctly but, other than tag likepage tag
androot tag
wasn't updated and display old cached data...2024-06-25.13.54.26.mov
How can I update current data by revalidate tag???👀
but,,, there is one thing, I succeeded in the specified tag's data.
I inject redirect function after revalidate tag and redirect to current route, I can found the my expectation that
layout tag
was updated and other than tag likepage tag
androot tag
wasn't updated like below the video.but I don't know this implementation is correct because this implementation example don't be writtern in the nextjs official document.
(I refered to the this youtube)
2024-06-25.14.01.22.mov
I love the nextjs, thank you for your project and the best effort for software enginner!!
Operating System
My sample example
sturcture of front-end
Endpoint: http://localhost:4000/v1/health/{a|b|c}
⇨ this end-point just return timestamp
Beta Was this translation helpful? Give feedback.
All reactions