Menu

htmlLimitedBots

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

next.config.ts
TypeScript
import type { NextConfig } from 'next'
 
const config: NextConfig = {
  htmlLimitedBots: 'MySpecialBot|MyAnotherSpecialBot|SimpleCrawler',
}
 
export default config

默认列表

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

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

版本历史

版本变更
15.2.0htmlLimitedBots 选项引入。