Server and Client caching in Next 14 development mode
Answered
Eulophid wasp posted this in #help-forum
Eulophid waspOP
Is server caching disabled on next 14 development mode by default ? the client caching seems to be working fine, but it looks like server caching isnt there.
Answered by B33fb0n3
yea, even if the page was loaded dynamically it can still be cached. However:
most of the caching mechanisms are disabled inside dev mode
14 Replies
@Eulophid wasp Is server caching disabled on next 14 development mode by default ? the client caching seems to be working fine, but it looks like server caching isnt there.
yes, most of the caching mechanisms are disabled inside dev mode
@B33fb0n3 yes, most of the caching mechanisms are disabled inside dev mode
Eulophid waspOP
dived a bit deeper and the reason was that my application uses cookies and headers
@Eulophid wasp dived a bit deeper and the reason was that my application uses cookies and headers
yea, even if the page was loaded dynamically it can still be cached. However:
most of the caching mechanisms are disabled inside dev mode
Answer
Eulophid waspOP
is the data cache technically the same as static rendering ?
@Eulophid wasp is the data cache technically the same as static rendering ?
when you statically render stuff, then the page exists already in html/css/js. This data is not saved inside the data cache. It's saved inside the full route cache
Eulophid waspOP
so i can still revalidate the data cache with
revalidatePath which will also update the statically rendered stuff ?@Eulophid wasp so i can still revalidate the data cache with `revalidatePath` which will also update the statically rendered stuff ?
yes, it can still be revalidated. Take a look at this: (see attached)
https://nextjs.org/docs/app/building-your-application/caching
https://nextjs.org/docs/app/building-your-application/caching
Eulophid waspOP
so even if a build the app and a specific route is static, a revalidation still updates it right ?
yes
Eulophid waspOP
thank you
its a bit hard to wrap my head around all this caching rendering thing
takes time i guess
yea, sometimes it can be a bit confusing. Thought asking questions and solving problems you will learn more and more. So no worries 🙂