next.js/test/e2e/app-dir/use-cache/app/(partially-static)/cache-life/page.tsx
page.tsx13 lines243 B
import { cacheLife } from 'next/cache'

async function getCachedRandom() {
  'use cache'
  cacheLife('frequent')
  return Math.random()
}

export default async function Page() {
  const x = await getCachedRandom()
  return <p id="x">{x}</p>
}
Quest for Codev2.0.0
/
SIGN IN