Skip to main content

With runtime data 실전 서브앱

runtime 값은 바깥에서 읽고 cached 함수 인자로 전달해 key를 만들어야 합니다.

session/요청 번호를 바꿔 extract-and-pass의 hit/miss를 확인해보세요.

파일 구조

cache-components/with-runtime-data/
|- page.tsx
\- demo/
   \- page.tsx

핵심 코드

const session = (await cookies()).get('session')?.value
return <CachedContent sessionId={session} />

실전 점검 체크리스트

  • - ProfileContent에서 runtime 추출
  • - CachedContent 인자화
  • - session 기반 key 검증
← 스터디로 돌아가기