next.js/test/e2e/app-dir/use-cache/app/(partially-static)/on-demand-revalidate/page.tsx
page.tsx23 lines474 B
import { revalidatePath } from 'next/cache'
import { RevalidateButtons } from './revalidate-buttons'

async function cachedValue() {
  'use cache'
  return Math.random()
}

export default async function Page() {
  const value = await cachedValue()
  return (
    <div>
      <p id="value">{value}</p>
      <RevalidateButtons
        revalidatePath={async () => {
          'use server'
          revalidatePath('/on-demand-revalidate')
        }}
      />
    </div>
  )
}
Quest for Codev2.0.0
/
SIGN IN