Caching data when using prisma
Answered
JM posted this in #help-forum
JMOP
When I fetch data from DB using prisma, does the server component automatically cache that data? What happens? If there is any post about this, can you share it? thank you.
Answered by joulev
does the server component automatically cache that datano
What happensnothing is cached, it will just be like a normal computation step in the server component
you need to set up caching manually with segment-level caching (
export const revalidate or export const dynamic) or with unstable_cache2 Replies
@JM When I fetch data from DB using prisma, does the server component automatically cache that data? What happens? If there is any post about this, can you share it? thank you.
does the server component automatically cache that datano
What happensnothing is cached, it will just be like a normal computation step in the server component
you need to set up caching manually with segment-level caching (
export const revalidate or export const dynamic) or with unstable_cacheAnswer
@joulev > does the server component automatically cache that data
no
> What happens
nothing is cached, it will just be like a normal computation step in the server component
you need to set up caching manually with segment-level caching (`export const revalidate` or `export const dynamic`) or with `unstable_cache`
JMOP
thank you!!!