Uploaded March 2024 | Updated December 2026, 3 hours ago
In this video, we'll use React's new `cache` function to optimize our NextJs app by caching data fetches and expensive computations and pre-loading data prior to rendering the component.
👉🏼 The Ultimate NextJs 14 Course
→ hamedbahram.io/courses/nextjs
👉🏼 Project source code (Github)
→ github.com/HamedBahram/react-cache
👉🏼 React documentation
→ https://react.dev/reference/react/cache
👉🏼 Work with me
→ hamedbahram.io/hire
Chapters
0:00 Intro
3:20 Convention
5:15 Caveats
7:45 Example usecases
12:20 When to use cache
15:25 Project code setup
16:50 Caching db queries
19:25 Preloading data
24:54 Recap
In this video, we'll use React's new `cache` function to optimize our NextJs app by caching data fetches and expensive computations and pre-loading data prior to rendering the component.
👉🏼 The Ultimate NextJs 14 Course
→ hamedbahram.io/courses/nextjs
👉🏼 Project source code (Github)
→ github.com/HamedBahram/react-cache
👉🏼 React documentation
→ https://react.dev/reference/react/cache
👉🏼 Work with me
→ hamedbahram.io/hire
Chapters
0:00 Intro
3:20 Convention
5:15 Caveats
7:45 Example usecases
12:20 When to use cache
15:25 Project code setup
16:50 Caching db queries
19:25 Preloading data
24:54 Recap






![Protecting routes in NextJs using Clerk middleware [6/6]
Using Clerk middleware to protect your routes in NextJs. The clerkMiddleware() integrates Clerk authentication through NextJs middleware.
👉🏼 Clerk auth
→ https://go.clerk.com/s1mVa9u
👉🏼 Learn Clerk
→ https://www.hamedbahram.io/courses/clerk Protecting routes in NextJs using Clerk middleware [6/6]](https://i.ytimg.com/vi/CCdf-TBbRmA/mqdefault.jpg)



