next.js/test/integration/telemetry/_app/use-cache/funtion-level-use-cache/page.jsx
page.jsx20 lines423 B
async function getCachedRandom(n) {
  'use cache'
  return String(Math.ceil(Math.random() * n))
}

async function getCachedRandomV2(n) {
  'use cache: custom'
  return String(Math.ceil(Math.random() * n))
}

export default async function Page() {
  const random = await getCachedRandom(10)
  const randomV2 = await getCachedRandomV2(10)
  return (
    <h1>
      Hello from cached page! {random} {randomV2}
    </h1>
  )
}
Quest for Codev2.0.0
/
SIGN IN