Skip to content

NextJS中文文档 - HtmlLimitedBots

htmlLimitedBots 配置允许您指定一个用户代理列表,这些用户代理应接收阻塞元数据,而不是流式元数据

ts
import type { NextConfig } from 'next'

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

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

默认列表

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

指定 htmlLimitedBots 配置将覆盖 Next.js 的默认列表,使您能够完全控制哪些用户代理应该选择使用此行为。但这是高级行为,对于大多数情况,默认设置应该足够。

版本历史

版本变更
15.2.0引入 htmlLimitedBots 选项。

🎉有任何问题,欢迎联系我

WeChat QR Code
WeChat
QQ QR Code
QQ

赣ICP备2023003243号