next.js/test/e2e/app-dir/use-cache/app/(partially-static)/imported-from-client/cached.ts
cached.ts26 lines383 B
'use cache'

import { cacheLife, cacheTag } from 'next/cache'

function getRandomValue() {
  const v = Math.random()
  console.log(v)
  return v
}

export async function foo() {
  cacheLife('days')
  return getRandomValue()
}

export const bar = async function () {
  cacheTag('bar')
  return getRandomValue()
}

const baz = async () => {
  return getRandomValue()
}

export { baz }
Quest for Codev2.0.0
/
SIGN IN