next.js/test/e2e/app-dir/use-cache-configured-timeout/app/above-dev-timeout/page.tsx
page.tsx21 lines509 B
// Cache body sleeps 17s, which exceeds the configured dev `useCacheTimeout`
// (15s) — proving the configured value is actually applied in dev (and
// not the hard-coded default or some other value).
async function getCachedData(): Promise<string> {
  'use cache'

  await new Promise((resolve) => setTimeout(resolve, 17_000))

  return 'cached'
}

async function Cached() {
  const data = await getCachedData()

  return <p id="result">{data}</p>
}

export default function Page() {
  return <Cached />
}
Quest for Codev2.0.0
/
SIGN IN