Repository navigation
Make the calendar finite for crawlers - #249
Merged
Merged
Conversation
Every date in every year is a valid page, so to a crawler the calendar never ends. In the peak hour of Oct 11, 78% of requests (6,974 of 8,980) were for dates outside is_indexable's +/-5-year window -- Meta's meta-externalagent was reading the 2280s, ClaudeBot the 1790s -- with almost no referers: they crawl from stored URL lists, so the pages' noindex/nofollow can't stop them. New middleware 404s self-declared crawlers (bot/crawl/spider/ externalagent in the User-Agent) for any URL whose year/month/day falls outside that window -- readings, calendar, and API alike -- before any calendar work. People and API clients (e.g. the mobile app) are untouched. The 404 is no-store and sits above cache_control, so Firebase's CDN never caches it for everyone. Also disallow the tradition-prefixed API routes (/api/greek/, /api/slavic/) in robots.txt, which the older entries didn't cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brianglass
force-pushed
the
finite-calendar-for-crawlers
branch
from
October 12, 2026 14:54
5d2b16c to
90cf502
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Traffic has grown 5–9× in two weeks, and most of it is crawlers working through an effectively infinite calendar. In the peak hour (Oct 11, 04:00 UTC), 78% of requests, 6,974 of 8,980, were for dates outside
is_indexable's ±5-year window.meta-externalagentwas reading the 2280s and ClaudeBot the 1790s.noindex/nofollowcan't stop them.What
orthocal.middleware.finite_calendar_for_crawlers: returns 404 to self-declared crawlers (user agent containsbot,crawl,spiderorexternalagent) for any URL whoseyear/month/dayfalls outside the window.Expo … CFNetworkagent, are untouched.Cache-Control: no-storewithX-Robots-Tag: noindex, nofollow. The middleware sits abovecache_control, so Firebase's CDN never caches a crawler's 404 and serves it to people.robots.txt: also disallows/api/greek/and/api/slavic/, which the older/api/gregorian/-style entries didn't cover.Meta isn't blocked: it can still crawl the ±5-year window. The sitemap already stays within it (±1 year).
Test plan
test_crawler_window:🤖 Generated with Claude Code