Access to all courses
Caching our Server Actions
If you've been following along with the Project, you've seen how to build a server action that fetches data from a database. If you've been testing your server action, you've probably noticed that that the data we're fetching is sometimes stale . You might have noticed that you need to refresh the page to see the latest updated data. This is a feature, not a bug. When we use tools like "router.push", we're not actually refreshing the page. We're just changing the URL. This means that the data we fetched when the page first loaded is still the data we're seeing. In this lesson, we'll learn how to use caching to make sure that the data we're seeing is always up-to-date.
The rest of this lesson is waiting.
Join JS Mastery Pro to unlock it.





Get Full Access
$149 /month
Lock in a year & save—2 months free!
Quizzes, mini-challenges, AI summaries, inline sandboxes
Participation in a private community
Build real production-grade apps
Mock interviews & project reviews
Weekly live sessions & member-only access