Data Cache is a cache storage that stores the return of a function call or a data fetching operations in the server. The Data Cache persists the result of those function across incoming server requests and deployments by storing it into a persistent caching semantics made by Next.js.
Currently, there are two ways to store data in the Data Cache:
fetch
api will store their result in the Data Cacheunstable_cache
so that the return of the function will be cached into the Data Cache.next
folder.fetch
function will not utilize the Data Cache on a dynamically rendered route. This includes both using Server Component and Route Handlers.fetch
function will not be cached in Server Action by default. However, unstable_cache will still return the cached result by default.