use cache
directive to the top of the function definition.1async function ProductList() {2'use cache';3// ...4}56export default async function Page() {7return <ProductList />;8}
use cache
.layout.tsx
and page.tsx
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.