use cache directive to the top of the function definition.async function getData() {
// !mark
'use cache';
// ...
}
async function ProductList() {
const products = await getData();
// ...
}
export default async function Page() {
return <ProductList />;
}
use cache.layout.tsx, page.tsx and <ProductList> aren't explicitly annotated with use cache, but Next.js infers they're static because they do not use any Dynamic APIs. If they started to, Next.js will guide the developer to either add use cache or a <Suspense> boundary.use cache directive and describes caching behavior once stable.







