Issue with default caching
Answered
fran posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
Hi all, I am having a problem with the default caching by nextjs, on my side I have 2 components that I don't want to cache ever. They both make a request to a redis database and return a number.
Currently both components use
Currently both components use
unstable_noStore
to prevent caching but it doesn't seem to work. I leave a reproduction of the error if someone can give me a hand, also a picture of both components.23 Replies
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
I leave the images of the components here:
![Image](https://cdn.discordapp.com/attachments/1190742643538395249/1190743057906282607/image.png?ex=65a2e8e3&is=659073e3&hm=7769aecd374e2d24d28fdcdf2b5d64b60c6bd18954c1342f6b6c285771b1f49f&)
![Image](https://cdn.discordapp.com/attachments/1190742643538395249/1190743058250203177/image.png?ex=65a2e8e4&is=659073e4&hm=4ecad1bcb7c8d0dbef61d6c967e7a7025fe93682f0590e099ff823d7424c262b&)
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
is the page static generated?
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
No, its dynamic
![Image](https://cdn.discordapp.com/attachments/1190742643538395249/1190747186439397517/Captura_de_pantalla_2023-12-30_a_las_21.03.21.png?ex=65a2ecbc&is=659077bc&hm=ddd5ce24ac5800234b919b7e903e4e195486a6ddd2eafc97328182c055e39575&)
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
there is a 30 sec router cache
do you see the value changed if you refresh the page
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
yeah, if i refresh i can see!
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
yes you hit the router cache
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
could be disabled?
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
try it in 30 sec
currently, no
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
😮
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
or use
<a>
tag instead of Link
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
i thought noStore invalidate all the "automatic caching"
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
but it is not recommended
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
![Image](https://cdn.discordapp.com/attachments/1190742643538395249/1190747954554875987/image.png?ex=65a2ed73&is=65907873&hm=36d4c09c5fc3cbcf98e09c4af3fa9902df525b95ba5636cbd346d79b2d2717c5&)
Answer
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
hmmmm so right now there is no "correct" way to achieve?
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
yeah no official way
![Avatar](https://cdn.discordapp.com/avatars/238241848613797889/3f886452e122cb7d560cfe5a863ed380.webp?size=256)
franOP
okey, so i will keep waiting
ty a lot @Ray!
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
np