Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
  • Loading branch information
huozhi and ztanner authored Feb 24, 2025
1 parent 1553777 commit bd7c416
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1201,13 +1201,13 @@ export const metadata = {
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.

Since SEO-focused metadata primarily targets crawler bots, we suspend metadata rendering for human users while keeping it blocking for certain **HTML-limited bots**.
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**.

Some bots, like `Googlebot`, can render pages like headless browser and execute JavaScript, 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.
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.
Next.js automatically detects the user agent of incoming requests to determine whether to serve streaming metadata or fallback to blocking metadata.
If you need to accommodate additional bots, you can define them manually using the `htmlLimitedBots` option in `next.config.js`. Next.js will ensure these specified bots receive blocking metadata when requesting your web page.
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.
```js filename="next.config.js"
module.exports = {
Expand Down

0 comments on commit bd7c416

Please sign in to comment.