Next.js App Router Caching Explained ๐Ÿ—ƒ๏ธ

Learn how to fetch, cache, and revalidate data with Next.js App Router in this comprehensive guide. Includes demo and caching basics.

Next.js App Router Caching Explained ๐Ÿ—ƒ๏ธ
Vercel
129.4K views โ€ข Jan 15, 2024
Next.js App Router Caching Explained ๐Ÿ—ƒ๏ธ

About this video

Learn how to fetch, cache, and revalidate data using the Next.js App Router.

0:00 โ€“ Introduction
0:24 โ€“ Demo
1:20 โ€“ Caching overview
2:06 โ€“ Foundations
6:10 โ€“ Static: fetch()
7:03 โ€“ Dynamic: fetch() without caching
7:37 โ€“ Static: unstable_cache()
9:37 โ€“ Dynamic: Direct database calls
10:07 โ€“ Revalidating static data
12:32 โ€“ Revalidating from external sources (webhooks)
14:12 โ€“ Revalidating static data with ISR
15:28 โ€“ React cache()
16:40 โ€“ App Router and Pages Router differences
17:52 โ€“ Example: Forms with useFormState & useFormStatus
19:33 โ€“ Using forms without JavaScript
19:59 โ€“ Exploring the network tab for a Server Action
20:49 โ€“ Example: Optimistic UI
21:45 โ€“ Preventing navigations with pending mutations
22:34 โ€“ Progressive enhancement
23:39 โ€“ Partial Prerendering
24:56 โ€“ Conclusion

โ—† Forms example: https://github.com/vercel/next.js/tree/canary/examples/next-forms
โ—† Optimistic UI example: https://github.com/vercel/next.js/tree/canary/examples/with-redis
โ—† Docs: https://nextjs.org/docs/app/building-your-application/caching
โ—† Deep dive: https://github.com/vercel/next.js/discussions/54075
โ—† Partial Prerendering: https://vercel.com/blog/partial-prerendering-with-next-js-creating-a-new-default-rendering-model

#nextjs #react

Video Information

Views

129.4K

Likes

3.4K

Duration

25:22

Published

Jan 15, 2024

User Reviews

4.7
(25)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.