Re-fetching data when component loads
Answered
Orchard Oriole posted this in #help-forum
Orchard OrioleOP
i have a navigation and 2 components. one of those components, UserInformation fetches user data and displays it. when i go to the other component and back, the data stays the same (even though its updated in the db)
how can i make sure it re-fetches the data every time? is it possible with a server component like this or does it have to be a client component?
how can i make sure it re-fetches the data every time? is it possible with a server component like this or does it have to be a client component?
10 Replies
Orchard OrioleOP
Anyone?
sound like router cache, does it show updated data when you refresh the page?
Orchard OrioleOP
Yes
try fetching the data client side if you want to prevent the data cache in router cache. because its impossible to disable router cache atm
Orchard OrioleOP
How would I do that?
I would suggest using react-query/swr
Answer
btw, is seo important for that page?
Orchard OrioleOP
Nope
I’ll look into it
Thanks