콘텐츠로 이동

Functions: unstable_noStore

Source URL: https://nextjs.org/docs/app/api-reference/functions/unstable_noStore

Copy page

이 API는 레거시로 더 이상 권장되지 않습니다. 하위 호환성을 위해 계속 지원됩니다.

최종 업데이트 2026년 2월 20일

버전 15에서는 unstable_noStore 대신 connection을 사용하는 것을 권장합니다.

unstable_noStore를 사용하면 정적 렌더링을 선언적으로 비활성화하고 특정 컴포넌트를 캐싱하지 말아야 함을 나타낼 수 있습니다.

import { unstable_noStore as noStore } from 'next/cache';
export default async function ServerComponent() {
noStore();
const result = await db.query(...);
...
}

알아두면 좋은 점 :

  • unstable_noStorefetch에서 cache: 'no-store'와 동일합니다.
  • unstable_noStore는 더 세밀하고 컴포넌트 단위로 사용할 수 있으므로 export const dynamic = 'force-dynamic'보다 선호됩니다.
  • unstable_cache 내부에서 unstable_noStore를 사용해도 정적 생성에서 제외되지 않습니다. 대신 캐시 구성에 따라 결과를 캐시할지 여부가 결정됩니다.

fetchcache: 'no-store', next: { revalidate: 0 } 같은 추가 옵션을 전달하고 싶지 않거나 fetch를 사용할 수 없는 경우, 모든 이러한 사용 사례를 대신해 noStore()를 사용할 수 있습니다.

import { unstable_noStore as noStore } from 'next/cache';
export default async function ServerComponent() {
noStore();
const result = await db.query(...);
...
}
VersionChanges
v15.0.0unstable_noStoreconnection으로 대체되도록 deprecated되었습니다.
v14.0.0unstable_noStore가 도입되었습니다.

supported.

Send