Skip to content

Block crawler access to dynamic explorer routes and optimize caching#796

Merged
jamespepper81 merged 2 commits into
mainfrom
dev
Jun 24, 2026
Merged

Block crawler access to dynamic explorer routes and optimize caching#796
jamespepper81 merged 2 commits into
mainfrom
dev

Conversation

@jamespepper81

Copy link
Copy Markdown
Contributor

No description provided.

claude and others added 2 commits June 24, 2026 16:21
Search/AI crawlers were walking the /transactions, /address and /block
pages as an effectively infinite spider trap (each page cross-links to the
others), running uncached server functions on every hit. This generated
large compute->CDN egress around the clock even with zero human users
(production logs showed 100% Applebot traffic on these routes).

- robots.ts: disallow /transactions, /address/ and /block/ for all bots
  and Googlebot (removed from allow lists). Compliant crawlers stay out.
- middleware.ts (new): edge-level enforcement for bots that ignore
  robots.txt. Matches the three route prefixes (catching both the page GET
  and the Server Action POST) and short-circuits known crawler UAs with a
  tiny 403 before the heavy function runs. Real users pass through; all
  responses on these routes carry X-Robots-Tag: noindex, nofollow.
- next.config.ts: edge-cache the explorer page shells
  (s-maxage=300, SWR) so repeat human GETs are CDN hits, not fresh compute.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EHCQFhXU1zen3gmq9ZMbHJ
Protect dynamic explorer routes from crawler traffic
@jamespepper81 jamespepper81 merged commit ff90dfb into main Jun 24, 2026
7 checks passed
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.

2 participants