Commit 3685993
docs(site): keep the agent-reader copies of every page out of the search index (#12303)
`/docs/<slug>.mdx`, its rewrite destination `/llms.mdx/docs/<slug>`, `/llms.txt`
and `/llms-full.txt` each serve the full text of documentation pages at a
crawlable URL with no robots directive of any kind, so every page exists twice
(three times, counting the aggregates) as far as a search engine is concerned.
Measured on production before this change: `/docs/data-modeling/objects.mdx` →
200 `text/markdown`, 28080 bytes, no `X-Robots-Tag` and no `Link` header.
Add `X-Robots-Tag: noindex` to all four from `next.config.mjs`'s `headers()`,
which matches the incoming request path and so covers `/docs/**.mdx` before the
rewrite rewrites it. The endpoints keep answering 200 with their full body —
they are how AI agents read these docs and nothing here gates, redirects or
content-negotiates them.
`noindex` over `Link: rel="canonical"` because only the per-page markdown has an
HTML twin to canonicalise to: `/llms.txt` and the 8 MB `/llms-full.txt` are
whole-site aggregates that are a duplicate of no single page, so a canonical
header could say nothing honest about the two largest copies on the site. It is
also a directive rather than a hint.
`robots.txt` keeps allowing all four paths — a `Disallow` would prevent the
fetch that reveals the header — and now names `llms.txt` and `llms-full.txt`
explicitly so agent crawlers find them deliberately rather than by convention.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 1524927 commit 3685993
2 files changed
Lines changed: 67 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
16 | 37 | | |
17 | 38 | | |
18 | 39 | | |
| |||
22 | 43 | | |
23 | 44 | | |
24 | 45 | | |
25 | | - | |
| 46 | + | |
26 | 47 | | |
27 | 48 | | |
28 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
65 | 110 | | |
66 | 111 | | |
67 | 112 | | |
| |||
0 commit comments