NextJS dynamic routes with „use cache“ and dynamicIO - examples?

Hi everyone 😃 Does anyone have an example with an cached dynamic route in the new dynamicIO way of doing it? Even though I saw an issue on GitHub, I can’t believe it’s in general not possible. I basically need a very common example for something like a blog. Requesting the page content from an external api in an server-function with use cache, cache tag and cache life and then generate the pages with a dynamic [slug]/page.tsx Thanks a lot in advance 🙏
2 Replies
ChrisEvans
ChrisEvans2w ago
Might not be exactly what you're looking for, but Jack HErrington just posted a video about this: https://youtu.be/ZDRGEewXkrs?si=wIMqaq_YDqP6JbZU&t=548
Jack Herrington
YouTube
“use cache” NextJS’s latest take on data caching
NextJS 15 has three different ways to handle data caching. Let's take a look at all three ways to cache data in your React app to get the best performance you can. Code: https://github.com/jherr/three-nextjs-caching-variations CacheLife: https://nextjs.org/docs/canary/app/api-reference/functions/cacheLife Our Journey With Caching: https://nextj...
Xanacas
XanacasOP2w ago
Thx! Haven’t had the time yet to dive into it, but after a quick check of the repo, he has at least the type of code I’m looking for 🙏 thanks @ChrisEvans

Did you find this page helpful?