You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/01-app/04-api-reference/04-functions/generate-metadata.mdx
+16-9
Original file line number
Diff line number
Diff line change
@@ -1197,31 +1197,38 @@ export const metadata = {
1197
1197
}
1198
1198
```
1199
1199
1200
-
#### Streaming Metadata
1200
+
## Streaming metadata
1201
1201
1202
-
Starting from v15.2, metadata returned by `generateMetadata` will be streamed to the client. This allows Next.js to inject metadata into the HTML as soon as it's resolved.
1202
+
Metadata returned by `generateMetadata` is streamed to the client. This allows Next.js to inject metadata into the HTML as soon as it's resolved.
1203
1203
1204
-
Since page metadata often primarily targets bots & crawlers, Next.js will continue to block the render until the metadata is resolved for**HTML-limited bots**.
1205
-
1206
-
Some bots, like `Googlebot`, can execute JavaScript and are able to inspect the full page DOM, meaning they **don't** require blocking metadata. However, bots like `Twitterbot` **cannot** execute JavaScript while crawling a page—they fall into the **HTML-limited** category.
1204
+
Since page metadata primarily targets bots and crawlers, Next.js will stream metadata for bots that can execute JavaScript and inspect the full page DOM (e.g. `Googlebot`). However, metadata will continue blocking the render of the page for**HTML-limited**bots (e.g. `Twitterbot`) as these cannot execute JavaScript while crawling.
1207
1205
1208
1206
Next.js automatically detects the user agent of incoming requests to determine whether to serve streaming metadata or fallback to blocking metadata.
1209
1207
1210
1208
If you need to customize this list, you can define them manually using the `htmlLimitedBots` option in`next.config.js`. Next.js will ensure user agents matching this regex receive blocking metadata when requesting your web page.
1211
-
Specifying a `htmlLimitedBots` config will override the Next.js' default list, allowing you full control over what user agents should opt into thisbehavior. This is advanced behavior, and the default should be sufficient for most cases.
>**Note:**Next.js includes [a default list ofHTML limited bots](https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/html-bots.ts)
1226
+
Specifying a `htmlLimitedBots` config will override the Next.js' default list, allowing you full control over what user agents should opt into this behavior. This is advanced behavior, and the default should be sufficient for most cases.
|`v15.2.0`|introduced streaming support to `generateMetadata`. |
1232
+
| `v15.2.0` | Introduced streaming support to `generateMetadata`. |
1226
1233
| `v13.2.0` | `viewport`, `themeColor`, and `colorScheme` deprecated in favor of the [`viewport` configuration](/docs/app/api-reference/functions/generate-viewport). |
1227
1234
| `v13.2.0` | `metadata` and `generateMetadata` introduced. |
description: Specify a list of user agents that should receive blocking metadata.
4
+
---
5
+
6
+
The `htmlLimitedBots` config allows you to specify a list of user agents that should receive blocking metadata instead of [streaming metadata](/docs/app/api-reference/functions/generate-metadata#streaming-metadata).
Next.js includes [a default list of HTML limited bots](https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/html-bots.ts).
27
+
28
+
Specifying a `htmlLimitedBots` config will override the Next.js' default list, allowing you full control over what user agents should opt into this behavior. However, this is advanced behavior, and the default should be sufficient for most cases.
0 commit comments