A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://nextjs.org/docs/app/api-reference/functions/unstable_noStore below:

Website Navigation


Functions: unstable_noStore | Next.js

unstable_noStore

This is a legacy API and no longer recommended. It's still supported for backward compatibility.

In version 15, we recommend using connection instead of unstable_noStore.

unstable_noStore can be used to declaratively opt out of static rendering and indicate a particular component should not be cached.

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

Good to know:

Usage

If you prefer not to pass additional options to fetch, like cache: 'no-store', next: { revalidate: 0 } or in cases where fetch is not available, you can use noStore() as a replacement for all of these use cases.

import { unstable_noStore as noStore } from 'next/cache';
 
export default async function ServerComponent() {
  noStore();
  const result = await db.query(...);
  ...
}
Version History Version Changes v15.0.0 unstable_noStore deprecated for connection. v14.0.0 unstable_noStore introduced.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4