use cache: remote
use cache
await connection()
await cookies()
await headers()
async function getProductPrice(id: string) { // !mark 'use cache: remote'; cacheTag(`price-${id}`); return await db.query(...); } async function ProductPrice({ id }: { id: string }) { // Ensure dynamic context await connection(); const price = await getProductPrice(id); return <div>Price: ${price}</div>; } export default async function Page() { return ( <Suspense fallback={<Skeleton />}> <ProductPrice id="1" /> </Suspense> ); }
getData()
getProductPrice()
cacheTag()