import { draftMode } from 'next/headers' import { unstable_expireTag, unstable_cache } from 'next/cache' import { RevalidateButton } from '../revalidate-button' export const dynamic = 'force-dynamic' export default async function Page() { async function revalidate() { 'use server' await unstable_expireTag('random-value-data') } const cachedData = await unstable_cache( async () => { return { random: Math.random(), draftModeEnabled: (await draftMode()).isEnabled, } }, ['random-value'], { tags: ['random-value-data'], } )() return (

random: {Math.random()}

cachedData: {cachedData.random}

draft mode enabled: {cachedData.draftModeEnabled.toString()}

) }