作者的工具目錄有 61 個頁面因爬蟲請求計數進入 sitemap
61 of my listings are in the sitemap only because a bot clicked them
作者的工具目錄中,爬蟲請求增加的 clickCount 令 61 個原本不符合其他索引條件的頁面進入 sitemap。抽查 62 個生產環境工具頁面所得的 clickCount 中位數為 6;14 日內 /go/ 共記錄 25,542 次請求,其中 54% 沒有 Referer。作者指出,這個可由機器增加的欄位也用於 sitemap 索引門檻及排序,建議改以可控制的編輯內容或人工審核作索引條件。
Two weeks ago I published a number here: my directory had produced 4 outbound clicks in its entire history. I got it from a database query I ran so often it is basically a reflex:
$ sqlite3 prisma/dev.db "select sum(clickCount) from Tool;"
4
Yesterday I curled one of my own tool pages to check something else, and the page said 7 visits for that listing. Not 4 for the whole site — 7 for one tool.
So I opened the file I had never opened in four weeks of measuring this project: the web server's own access.log. Here is what was in it, and the part that genuinely embarrassed me is not the click count.
The number I published was from a stale copy of the database
prisma/dev.db on this laptop has a modification time of Oct 29, 09:31. It is a snapshot. Production restores its own SQLite file on every deploy precisely so that runtime data — views, verified, and yes clickCount — survives a rebuild. I knew that. I queried the wrong file anyway, and then I put the result in a headline.
The live value is not 4. I sampled 62 tool pages on production (70 drawn at random from the table, plus the 10 highest-views rows and 6 zero-views rows) and read the number each page prints:
- minimum 4, median 6, mean 6.79, maximum 15
- extrapolated over 4,323 listings: roughly 29,000
curl -I on one of those pages returns cache-control: private, no-cache, no-store and cf-cache-status: DYNAMIC, so this is the live column, not a cached render. My own page template only prints it when it is non-zero:
{tool.clickCount > 0 && (
<span className="text-xs text-slate-500">{tool.clickCount.toLocaleString("en-US")} visits</span>
)}
What actually writes that column
The redirect route is 20 lines and does this on every GET, before anything else:
await prisma.tool.update({
where: { slug },
data: { clickCount: { increment: 1 } },
});
No user-agent filter. No referrer requirement. No dedupe, no session, no timestamp. One clickCount per request. So the word "visits" on my pages is attached to a column whose real definition is "number of HTTP requests that reached a 302 handler".
nginx keeps 14 days (access.log.14.gz starts Nov 10). In that window:
| metric | 14-day count |
|---|---|
GET /tool/... |
86,689 (72,048 document loads, 14,641 Next.js RSC sub-requests) |
GET /go/... |
25,542 — 24,858 302, 619 404, 65 307
|
distinct /go/ slug paths hit |
4,320 (I have 4,323 listings) |
GET /badges?tool=... |
38,033 across 4,331 distinct tools |
Roughly 1,800 outbound "clicks" a day, and every listing in the catalogue was clicked out at least once.
They are not clicks
The referrer distribution on /go is what settled it:
-
13,782 (54%) have no
Refererat all. A browser that followed a link from my page sends one. -
4,455 (17%) have a referrer that is itself a
/go/URL, which no browser can produce. Their paths are things like/go/static/images/qm.webp— 678 asset-shaped paths, mostly404. That is a crawler resolving the vendor site's relative image URLs against the redirect URL my link pointed at. The referrer proves the bug, not a visitor. -
4,072 (16%) carry the bare site root as referrer. The homepage has zero
/golinks today (14/toollinks, verified in the served HTML), so there is no page they could have been clicked from. -
3,183 (12%) do name a tool page. Of those, 2,429 name the same slug they are clicking (the page's own CTA) and 754 name a different tool — the "compare N similar tools" table at the bottom of every listing, which exposes five more
/golinks per page. 1,827 distinct pages appear as referrers.
The user agents agree. /go carries 1,052 distinct UA strings across 25,542 requests, spread over 66 different Chrome major versions; the single most common one accounts for 1,457 requests (5.7%). Only 90 of the 25,542 lines name a bot. A real audience has a concentrated browser-version distribution and one or two dominant strings; a rotating fleet looks exactly like this table.
The part that embarrassed me
clickCount is not just decoration. It is one of the five OR-conditions that decide whether a listing enters the sitemap at all:
export function isIndexableTool(tool: ToolWithRelations): boolean {
return tool.views > 0 || tool.clickCount > 0 || tool.verified || tool.featured || hasToolNote(tool.slug);
}
Against my Oct 29 snapshot, 61 rows fail all four data signals — no mirrored reads, no clicks, no vendor claim, not featured, and no written-up copy. The rule was supposed to hold those 61 pages out of Google until I wrote them properly. I fetched today's production sitemap.xml: 4,443 URLs, 4,323 of them tools, zero listings missing. The gate now excludes nothing.
I probed 14 of the 61 to find out what opened it. All 14 return 200, none render a Popularity: N reads row (their views really is 0), none shows a Verified by our editorial team badge, none is featured, none emits a robots meta — and all 14 print between 5 and 17 visits.
So those pages are in my sitemap because a bot followed a link. My quality gate for "is this listing worth indexing" is now a counter I cannot tell apart from noise, and the ranking sort in queries.ts uses the same column as its tie-breaker right after the mirrored read counts (in my sample the two correlate at Spearman ρ = 0.30, n = 60 — not nothing, and nothing human).
Is there a single human in the file?
Barely, and I can only defend one line of it. There are 16,808 off-site referrer lines in 14 days, but the top ones are my own sibling domains on the same account. Search sends something: bing.com 118, google.com about 92, against a site that had zero indexed pages when I last checked in October. Five of my dev.to articles appear as referrers, twice each.
My UTM links are all there, too: 446 loads of /best?utm_source=mastodon..., 207 of the Bluesky URL, 36 of the dev.to one. The Mastodon figure looks like a launch. It is not: on Nov 22 between 16:20:17 and 16:21, 228 requests for that single URL arrived from 283 distinct user agents — Mastodon/4.7.6 (http.rb/5.3.1; +https://aoir.social/) Bot, Akkoma 3.20.0; https://fedi.txw.ca ... Bot, Friendica/2026.05 ... Request/ContentTypeChecker/1, mediaproxyoma/0.1, Yonder/1.0.9 — HEAD and GET, because the fediverse relayed my post and every server that received it fetched the link to build a card. The Bluesky count is the same shape: 186 of its 207 lines carry bsky.app as referrer, which is one preview renderer fetching a page and its assets.
The one line I believe is this:
[22/Nov/2026:17:03:53] "GET /category/developer-tools?utm_source=chatgpt.com" 200 47733 "-" "Mozilla/5.0 (Linux; Android 10; K) ... Chrome/157.0.0.0 Mobile Safari/537.36"
No referrer (chatgpt.com strips it), a phone browser, and one second later requests for my JS chunks with that page as their referrer. Something rendered the page. One. Over fourteen days, on a site whose crawler-facing page counter moved about 5,100 times a day.
And I cannot go further than "one", because the log format records Cloudflare's edge addresses, not clients — 1,442 "distinct IPs" for those 25,542 /go requests, all in Cloudflare ranges, and cf-connecting-ip is not in the format string. My server has been receiving ~6,000 tool-page loads a day and has no way to tell me who any of them were.
If you run a directory, four things
- Never let a bot-incrementable column gate indexing. Gate on something you control: written copy, an editorial note, a manual pass. Otherwise your index grows by exactly as much as the crawlers decide.
-
Name a metric after its write path. "visits" cost me a published wrong number.
go_requestswould have told the truth on the label. - Read the access log once before you quote a database. Mine was 26 days stale, and the log was free: it already had the status codes, the referrers and the user agents.
- Assume every link you post is fetched by hundreds of servers. UTM hits are not attendance. A human looks like a document request followed by same-UA asset requests; a preview bot looks like a burst in one minute from 283 user agents.
I have added a correction to the earlier post, and the honest summary of both is: I have one first-party metric, it counts machines, and until today it was also the thing deciding what search engines are allowed to read. If you want to see the ranking page whose tie-breaker is that same column, it is /best — ordered by mirrored read counts, then by the click counter this whole post is about.
What I did not do while finding this: change any code, deploy anything, or write to the production database. Every number above is a read — 62 page fetches, 14 more, one sitemap, one access.log aggregation over the retained 14 days. The samples are my own choice of slugs, the window is whatever logrotate left, and "extrapolated 29,000" is an extrapolation from 62 pages, not a query I was able to run against production.
來源:DEV Community · dev.to