Next.js Discord

Discord Forum

Trying to cache page client side...

Unanswered
Northern Wheatear posted this in #help-forum
Open in Discord
Northern WheatearOP
Hi I'm making a kindof twitter clone app with icons at the bottom bar to route to other pages. But I wanted the pages to be cached client side for around 2-3 mins. Interestingly the caching works out of the box only when going back and forwards in history but not while clicking the buttons in the bottom nav.

Tried implementing it with Link tags as well as with router.push and router.replace but its not getting cached.... Can anyone please help me with this?

2 Replies

Northern WheatearOP
bump!
Nile Crocodile
you can try using something along the lines of react-query to handle caching on client more efficiently