Re-fetching data when component loads
Answered
Orchard Oriole posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
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
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Orchard OrioleOP
Anyone?
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
sound like router cache, does it show updated data when you refresh the page?
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Orchard OrioleOP
Yes
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
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
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Orchard OrioleOP
How would I do that?
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
I would suggest using react-query/swr
Answer
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
btw, is seo important for that page?
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Orchard OrioleOP
Nope
I’ll look into it
Thanks