LESSON 07 · Retries and change detection

Revisit without looping

Schedule recrawls by observed value and change rate while controlling traps.

SYSTEM VIEW

The crawl path

Diagram view
/news—
/about—
Recrawl load—

Watch two pages’ visit histories set how soon each comes back, then see what retries and a calendar trap cost.

  1. The Fetch worker fetches example.org/news and its content hash differs from the last visit’s, so Crawl history logs /news visit 24 as diff. It keeps each URL’s fetch times, content hash, last change and validators, such as an ETag, a version tag the server assigned.

    Kept per URL
    hash, ETag, change time

    What changed

    • GET /news: 200, new hash
    • /news visit 24: diff
  2. Next, example.org/about. The Fetch worker sends a conditional request, If-None-Match with the stored ETag, and the server answers 304 Not Modified without a body, saving the bandwidth of resending it. Crawl history logs /about visit 25 as same, and the URL stays in the schedule.

    Request
    If-None-Match: ETag
    Answer
    304, no body

    What changed

    • GET /about, If-None-Match
    • 304 Not Modified, no body
    • /about visit 25: same
  3. With example values: /news changed on its last four daily visits, so the Recrawl planner moves it to every 12 hours. /about was unchanged for five visits, so it moves to every 2 days, up to a cap. Pages that change often or matter more come back sooner.

    Changed 4 in a row
    every 12 h
    Unchanged 5
    every 2 days, capped

    What changed

    • /news every 12 hours
    • /about every 2 days
  4. Across the whole crawl, recrawling 10 million pages a day takes about 116 fetches a second, nearly a third of a 386-per-second crawl: 3 in every 10 fetches here, in blue. That share finds no new pages, so the budget decides how far adapting goes.

    Recrawls
    10 million pages a day
    That is
    about 116 of 386 fetches/s

    What changed

    • 116 recrawls/s of 386/s
    • Fewer fetches for new pages
  5. On a later visit, example.org/news answers 503 with Retry-After: 120. A temporary failure is retried with bounded exponential backoff and jitter, honoring Retry-After: here in 2 minutes, at most 3 times (example values). Permanent errors and policy exclusions are not retried; their reasons are kept.

    Temporary
    retry, back off
    Permanent
    stop, keep the reason
    Policy
    excluded, recorded

    What changed

    • 503 · Retry-After: 120
    • Retry 1 of 3, in 2 minutes
  6. A calendar on example.org links each date to the next: a spider trap, which generates URLs without end. After a few dates, the Link filter’s per-site cap on /cal/* stops the rest. A universal trap detector would also block real pages; site rules or human review may be needed.

    Cap
    per site, per pattern
    Also cap
    length, depth, params

    What changed

    • Link filter
    • /cal/* capped for example.org

Space plays · ← → step · Home resets

THE IDEA

How it works

A crawl is never truly finished if pages can change. Record fetch history, content hash, response validators, and last change time. Validators are values such as an ETag (a version tag the server assigned) that let the crawler ask whether anything changed. Schedule frequently changing or important pages sooner and stable pages later. Conditional requests such as If-None-Match or If-Modified-Since can save bandwidth when a server supports them; a 304 means no new representation was sent, not that the URL disappears from the schedule.

An adaptive rule might work like this, with example values. A page that changed on its last four daily visits moves to every 12 hours; one unchanged for five visits moves to every 2 days, up to a cap. Budget decides how far this goes. Recrawling 10 million pages daily takes about 116 fetches per second, nearly a third of a 386-per-second crawl, and that share is no longer finding new pages.

Retry transient failures with bounded exponential backoff and jitter, honoring Retry-After where relevant. Distinguish permanent errors, policy exclusions, and temporary failures. A spider trap is a site structure that generates URLs without end, whether by accident or on purpose. Cap retries, URL length, path depth, parameter variation, and per-site discovery when patterns suggest one. Human review or site-specific rules may be needed; a universal trap detector will also suppress legitimate pages.

DECISION POINT

A calendar generates a new URL for every future date. What protects the crawler?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Freshness depends on change history and importance, not one global recrawl interval.
  • Bound retries and suspicious URL expansion while preserving reasons for exclusion.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 2
RecallQUESTION 01

What can a conditional request save when content is unchanged?

Choose an answer. You’ll see the explanation once you get it right.

Next lesson

0 of 2 checkpoints answered correctly to complete this lesson.