Skip to content

htmlLimitedBots

htmlLimitedBots 配置允许你指定应接收阻止元数据而不是 流元数据 的用户代理列表。

¥The htmlLimitedBots config allows you to specify a list of user agents that should receive blocking metadata instead of streaming metadata.

ts
import type { NextConfig } from 'next'

const config: NextConfig = {
  htmlLimitedBots: 'MySpecialBot|MyAnotherSpecialBot|SimpleCrawler',
}

export default config
js
module.exports = {
  htmlLimitedBots: 'MySpecialBot|MyAnotherSpecialBot|SimpleCrawler',
}

默认列表

¥Default list

Next.js 包含 HTML 受限机器人的默认列表

¥Next.js includes a default list of HTML limited bots.

指定 htmlLimitedBots 配置将覆盖 Next.js 的默认列表,让你完全控制哪些用户代理应该选择此行为。但是,这是高级行为,默认值应该足以满足大多数情况。

¥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.

版本历史

¥Version History

版本更改
15.2.0引入 htmlLimitedBots 选项。

Next.js v15.2 中文网 - 粤ICP备13048890号