-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Next.js 15 RC updates (#67839)
[DOC-3018](https://linear.app/vercel/issue/DOC-3018/nextjs-15-rc-updates) New APIs: - Fetch HMR cache - Static Indicator - `onRequestError` --------- Co-authored-by: Hendrik Liebau <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
- Loading branch information
1 parent
4d589db
commit cf44916
Showing
51 changed files
with
213 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
docs/02-app/02-api-reference/05-next-config-js/serverComponentsHmrCache.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: severComponentsHmrCache | ||
description: Configure whether fetch responses in Server Components are cached across HMR refresh requests. | ||
--- | ||
|
||
The experimental `serverComponentsHmrCache` option allows you to cache `fetch` responses in Server Components across Hot Module Replacement (HMR) refreshes in local development. This results in faster responses and reduced costs for billed API calls. | ||
|
||
By default, the HMR cache applies to all `fetch` requests, including those with the `cache: 'no-store'` option. This means uncached requests will not show fresh data between HMR refreshes. However, the cache will be cleared on navigation or full-page reloads. | ||
|
||
You can disable the HMR cache by setting `serverComponentsHmrCache` to `false` in your `next.config.js` file: | ||
|
||
```ts filename="next.config.ts" switcher | ||
import type { NextConfig } from 'next' | ||
|
||
const nextConfig: NextConfig = { | ||
experimental: { | ||
serverComponentsHmrCache: false, // defaults to true | ||
}, | ||
} | ||
|
||
export default nextConfig | ||
``` | ||
|
||
```js filename="next.config.js" switcher | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
experimental: { | ||
serverComponentsHmrCache: false, // defaults to true | ||
}, | ||
} | ||
|
||
module.exports = nextConfig | ||
``` | ||
|
||
> **Good to know:** For better observability, we recommend using the [`logging.fetches`](/docs/app/api-reference/next-config-js/logging) option which logs fetch cache hits and misses in the console during development. |
7 changes: 7 additions & 0 deletions
7
docs/03-pages/02-api-reference/02-file-conventions/instrumentation.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: instrumentation.js | ||
description: API reference for the instrumentation.js file. | ||
source: app/api-reference/file-conventions/instrumentation | ||
--- | ||
|
||
{/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.