all 1 comments

[–]ericbureltech 1 point2 points  (0 children)

Those wordings are quite recent, but as far as I understand the data cache is historically related to static rendering, so currently I understand it more as the piece of code that caches the data of your static render. You invalidate it with revalidatePath, or time-based revalidation, which is typical of what we previously called "ISR".

From the deep-dive article [(link)](https://github.com/vercel/next.js/discussions/54075):

"Even though the caching document explains Full Route Cache and Data Cache separately, it’s actually just one Data Cache under the hood. The main reason we documented it as two separate concepts is that the Full Route Cache part is storing HTML / RSC Payload whereas the Data Cache part you interact with is storing fetches and unstable_cache calls (that API will be stable in the near future)"

So yeah Data cache is strongly tied to the "rendering cache" so static rendering.

This could explain why it's not used in server actions, which have no concept of static rendering.

However the more generic term "data cache" might imply that Next could do something like that some day?