Back to Browse

Nuxt 3.8 - Client-side caching with getCachedData ✨

24.2K views
Premiered Oct 20, 2023
9:30

⚡️ Nuxt 3.8 was released just a day ago, packed with lots of amazing features. Among the updates, one change for `useFetch` and `useAsyncData` is pretty significant IMO - `getCachedData`. In this video, we will explore how that function can avoid superfluous calls to an API and cache data for visitors on the client, either until a hard-reload or even with a custom TTL logic. Key Takeaways: 🛠️ What is getCachedData 🚀 How to avoid extra requests if fetching data once is sufficient ⚡️ Where to put the logic for custom caching mechanisms Links: 🔗 Code: https://github.com/manniL/nuxt-get-cached-data 🔗 Vue directive docs: https://vuejs.org/guide/reusability/custom-directives.html 🔗 Nuxt 3 docs: https://nuxt.com/docs/api/composables/use-fetch#params Whether you're a Nuxt.js pro or a newbie, this video is packed with valuable insights and practical examples to make your websites more user-friendly and dynamic. Don't forget to hit that "Subscribe" button, ring the notification bell and give a thumbs up! 🌐 Connect further: Website: https://www.lichter.io Twitter/X: https://twitter.com/TheAlexLichter Twitch: https://www.twitch.tv/TheAlexLichter Chapters: 00:00 Intro 00:35 Explaining getCachedData in Nuxt 3.8 00:58 A simple getCachedData implemenetation 04:50 getCachedData with custom TTL logic 08:14 Summary #Nuxt3 #vuejs #nuxtjs #webdevelopment #frontend #frontenddeveloper #caching #ssr #getCachedData

Download

1 formats

Video Formats

360pmp415.3 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Nuxt 3.8 - Client-side caching with getCachedData ✨ | NatokHD