Skip to content

Trim the crawl surface so bots cost less to serve - #86

Merged
raj-khan merged 1 commit into
mainfrom
task-82-crawl-surface
Sep 20, 2026
Merged

raj-khan merged 1 commit into
mainfrom
task-82-crawl-surface

Conversation

@raj-khan

Copy link
Copy Markdown
Owner

Why

Part of getting back inside the Vercel free tier. Station pages cannot be CDN cached while the CSP nonce forces per-request rendering, so every crawler visit to one is a full render. The sitemap listed 1615 station pages and robots.txt deliberately names 21 AI crawlers as welcome on top of the search engines, so that count was multiplied by every bot making a pass.

What

  • MAX_SITEMAP_STATIONS drops from 2000 to 600. The selection is already ranked by clicks plus votes, so this keeps the stations people actually search for and sheds the tail that was drawing least.
  • Station entries ask for a monthly recrawl rather than weekly. A station's name, country and tags rarely move, so a weekly sweep was paying for a fresh render four times as often as the page earned.

Browse pages (country, tag, language, combos) are untouched: there are far fewer of them and they are the ones that rank.

Trade-off

This is a deliberate reduction in indexed long tail. It is the lever available while the strict CSP stays, since the pages themselves cannot be cached. If the nonce is ever dropped in favour of ISR, the cap can go back up.

Verification

npm run lint, npm run typecheck, npm test (465 passing), npx prettier --check . and npm run build all pass locally. The sitemap tests are written against an explicit cap argument, so they are unaffected by the constant.

A station page is rendered per request, because the CSP nonce rules out
caching it, and robots.txt welcomes every named AI crawler as well as
the search ones. Listing 1615 stations therefore bought 1615 renders on
every pass any of them made. The list is ranked by clicks and votes, so
the cap drops to 600 and sheds the tail that was drawing least, and
station entries ask for a monthly rather than weekly recrawl.
@raj-khan
raj-khan merged commit 93570d9 into main Sep 20, 2026
3 checks passed
@raj-khan
raj-khan deleted the task-82-crawl-surface branch September 20, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant