Change Next.js Router Cache Duration (StaleTimes) 💡

Published: 17 April 2024
on channel: Coding in Flow
4,962
255

You can now change how long the Next.js client-side router caches pages via the staleTimes option in next.config. This way you can avoid your app showing old data after clicking a link to a page.

⭐ Get my full-stack Next.js with Express & TypeScript course: https://codinginflow.com/nextjs
✅ Get my free React Best Practices course: https://www.codinginflow.com/reactbes...
💌 Join my newsletter for regular web dev tips: https://codinginflow.com/newsletter
💬 Join our developer community on Discord: https://codinginflow.com/discord

📣 Follow Coding in Flow on social media:
Twitter:   / codinginflow  
Instagram:   / codinginflow  
TikTok:   / codinginflow  
Facebook:   / codinginflow