A collector runs through several proxies, and one worker cannot retrieve robots.txt. Should that worker continue because another exit address might work?

I would make the decision at the target-service level, before choosing an exit address. Fetch and interpret the applicable rules, preserve the result with its origin and crawler identity, and give every worker the same current decision. A different proxy must not become a way to discard a site's restrictions or multiply its request allowance.

This guide explains an operational workflow for authorized HTTP collection. It follows RFC 9309, the Robots Exclusion Protocol, while separating protocol behavior from stricter project policy. Robots rules are not access authorization: contractual permission, authentication, privacy obligations, and data-use restrictions still require separate decisions.

Fetch rules for the service you are actually visiting

The rules live at the top-level lowercase path /robots.txt. Keep the scheme, hostname, and effective port with the result. A rule fetched for one service is not a global rule for every hostname operated by the same organization.

Use a truthful, stable crawler identification string. RFC 9309 defines a product token made from letters, underscores, and hyphens and says it should be a substring of the identification sent to the service. For example, the product token ResearchCollector can appear in ResearchCollector/1.0 with an accurate purpose/contact page. Do not claim another crawler's identity to obtain a different rule group.

For each fetch, retain the initial origin, fetch time, status or network error category, redirect outcome, selected crawler token, parser version, and a rule-content fingerprint. Exclude proxy credentials and unrelated response data. Retain the rule text under appropriate access and retention controls when reproducibility requires it.

Handle a failed fetch explicitly

A 404 and a network timeout are different outcomes under the protocol. A queue should preserve that difference instead of treating every failure as an empty allow-all file.

Fetch outcomeRFC 9309 behaviorOperational action for this workflow
Successfully obtained fileFollow its parseable rulesPublish a versioned rule decision to workers
RedirectsFollow at least five consecutive redirects; rules reached within that chain apply to the initial authorityBound redirect handling and validate destinations before fetching
Unavailable resource, such as HTTP 4xxProtocol permits accessing resourcesStill apply project authorization and target-specific policy
HTTP 5xx or network errorAssume complete disallow while the file is unreachable, subject to the standard's long-term/caching provisionsHold new work; use only an explicitly designed cached-policy path
File contains parsing errorsTry each line and use parseable rulesDo not discard valid restrictions because another line is malformed
Access refusal or 429Do not interpret the protocol's 4xx permission as a business entitlementThis workflow pauses for review or throttling

The last row is a deliberately stricter operational choice. For rate-limit responses, the HTTP 429 explanation and Retry-After guidance help define the pause. Switching exits should not reset a service-level hold.

Redirect handling deserves its own fetch policy. The RFC's cross-authority redirect recommendation does not make arbitrary destinations safe for an internal fetcher. Validate allowed schemes and destinations at every hop and protect private network access. If a required redirect cannot be followed under your security policy, record an unresolved fetch and hold the work; do not claim that the policy check succeeded.

Select the group before matching the path

Match the crawler product token case-insensitively. Combine rules from multiple groups that match that product token. Use the * group when no matching token group exists; do not automatically merge wildcard rules into a matching specific group.

Within the applicable rules, use the most specific matching rule. The standard defines specificity by the number of matching octets, with Allow preferred when Allow and Disallow are equivalent. Rule matching should be case-sensitive. Proper percent-encoding and wildcard handling matter, so a few string-prefix checks are not a complete parser.

Consider this illustrative file:

User-agent: ResearchCollector
Disallow: /private/
Allow: /private/public/

User-agent: ResearchCollector
Disallow: /exports/drafts/

User-agent: *
Disallow: /archive/

For ResearchCollector, /private/report is disallowed, /private/public/report is allowed by the more specific rule, and /exports/drafts/report is disallowed by the combined matching groups. The wildcard /archive/ restriction is not part of the selected specific groups in this example. Independent project scope can still exclude the archive.

This example explains rule selection. It is not a complete robots implementation or evidence about any live website. Acceptance fixtures for your actual parser should additionally cover *, $, percent-encoding, equivalent rules, empty directives, and rules outside groups. Check those outcomes against the RFC rather than assuming a parser's method name establishes conformance.

Make one rule result govern every worker

I would keep rule resolution separate from proxy allocation. A scheduler can make the following sequence observable without building a separate monitoring system:

1. Resolve the task's authorized origin and crawler identity. 2. Load or refresh the applicable robots decision. 3. Check the exact candidate URL against the chosen rules and project scope. 4. Apply the shared request budget and any active hold. 5. Allocate the approved network route and dispatch the request. 6. Record the rule version and outcome with the logical task.

A worker that cannot obtain a valid decision should not substitute its own permissive interpretation. Recheck queued but undispatched URLs after a rule update. For in-flight tasks, use a documented cancellation or completion policy appropriate to the application; do not pretend an update can retroactively unsend a request.

The shared request budget is an engineering policy, not a request-rate value supplied by RFC 9309. The core standard does not standardize Crawl-delay. If a site or an agreement uses that field or another rate instruction, document how your scheduler handles it instead of promising universal parser support.

Cache rules without losing their scope

RFC 9309 permits caching and says cached content should not normally be used beyond 24 hours unless robots.txt is unreachable. This is not an instruction to fetch once every 24 hours regardless of changes, cache-control, or project needs.

Separate the rule cache from page-result caching. A rule decision needs an origin and crawler-token scope. A collected representation may also depend on account, language, and region. The HTTP cookies guide explains one reason equal URLs can have different collection contexts.

If authorized observations show that a service supplies materially different rule files in different collection contexts, retain those distinctions for review. Do not shop among responses for the least restrictive version. A conservative hold is more defensible than an undocumented rule-selection shortcut.

What to ask from a managed collection service

The useful question is whether the service can explain an admission decision, not whether a marketing page says it “respects robots.” Ask how it identifies the crawler, selects groups, handles unreachable files, updates cached rules, and propagates holds across workers and exits. If it does not expose those controls, keep the policy decision in your own scheduler and verify what the service actually fetches.

A simple acceptance record should make it possible to distinguish “not attempted because policy disallowed it” from “attempted but transport failed.” That distinction also improves valid-record accounting: excluded work should not disappear into an undifferentiated network-error count.

Start with one approved origin and a small fixture suite. Confirm rule decisions and dispatch behavior before increasing worker count. This article provides a protocol-based workflow and illustrative examples; it does not report a live crawler, parser benchmark, or vendor compliance test.

Frequently asked questions

Does an Allow rule grant legal permission to collect or reuse data?

No. RFC 9309 explicitly distinguishes robots rules from access authorization. Confirm the relevant agreement, authentication, personal-data obligations, and intended use separately.

Can each proxy have its own request budget?

A proxy can have a technical capacity limit, but that should not multiply the target service's allowed request rate. Maintain the service-level budget and active holds across routes.

Should a 404 robots response be treated like a timeout?

No. The RFC distinguishes an unavailable resource such as 4xx from an unreachable service or network error. Record the actual outcome and apply any stricter project policy; do not silently collapse both into an empty rule file.

Is Sitemap part of the core Allow and Disallow matching grammar?

No. RFC 9309 allows additional records, including sitemap information, but their parsing must not interfere with the core rule groups. A sitemap location helps discovery; it does not override a Disallow decision.

About the author

陈序 is a virtual editorial author focused on proxy product selection and application analysis, translating task requirements into clear acceptance criteria and practical trade-offs.

Expertise: Proxy product selection; application fit; plan and billing conditions; trial acceptance; long-term operating requirements.