LESSON 05 · URL and content identity

Remove repeated work carefully

Normalize URL identity, then compare content separately after fetching.

SYSTEM VIEW

The crawl path

Diagram view
Queued—
Dropped—
Duplicates—

Watch one link get normalized and checked before its fetch, then watch its content get compared after.

  1. The Parser resolves a link against its source page, and the Link filter normalizes it before queueing: scheme and host lowercased, default port 80 and the fragment #top removed (a fragment is never sent to the server), /a/../b resolved. HTTP://Example.com:80/a/../b#top becomes http://example.com/b.

    Found
    HTTP://Example.com:80/a/../b#top
    Becomes
    http://example.com/b

    What changed

    • Scheme and host lowercased
    • Port 80 and #top removed
    • /a/../b resolves to /b
  2. Two more links reach the Link filter: example.com/b?ref=feed and example.com/b?print=1. It keeps their query parameters: like path case and parameter order, even a tracking-like parameter can change a resource. Redirects and canonical hints (a page’s preferred address) are signals; they don’t erase a URL’s history.

    What changed

    • example.com/b?ref=feed
    • example.com/b?print=1
    • Query parameters kept
  3. The Link filter checks each normalized URL with the URL-seen set, which records it: all 3 are new and join the URL frontier. A later repeat of http://example.com/b is dropped before any fetch. At 8 bytes per URL, 10 billion URLs take 80 GB before index overhead: a real capacity item.

    Per URL
    8-byte fingerprint
    10 billion URLs
    80 GB

    What changed

    • URL-seen set
    • 3 new URLs queued
    • Repeat of /b dropped before fetching
  4. Content can only be compared after a fetch supplies the bytes. The Fetch worker fetches example.com/b, then example.com/b?ref=feed, and Crawl history stores each body’s SHA-256. The two hashes match: the same bytes reached through two URLs, a cheap duplicate signal.

    Fetched
    /b, /b?ref=feed
    SHA-256
    match

    What changed

    • Crawl history
    • 2 pages fetched, 2 SHA-256 hashes
    • ?ref=feed is a copy of /b
  5. Next comes example.com/b?print=1: the same article, different boilerplate. Even one changed timestamp gives a completely different SHA-256, so the exact check misses it. SimHash, a fingerprint where similar documents get similar values (Google published work on it), lands near /b’s: a near-duplicate.

    SHA-256
    different
    SimHash
    near /b’s

    What changed

    • ?print=1 fetched
    • SHA-256 differs from /b
    • SimHash: a near copy of /b
  6. Crawl history keeps all 3 URLs, each linked to its content: 3 URLs, 2 contents. Stored bytes can be shared, but no URL is discarded, because duplicate content may still have distinct links, provenance or future changes. A discarded URL would leave the recrawl schedule.

    /b and ?ref=feed
    one content
    ?print=1
    near copy

    What changed

    • 3 URLs, 2 contents
    • Each URL keeps its fetch history
  7. Both checks, before and after the fetch, can err. Merge too eagerly and you lose real pages; merge too timidly and you spend fetch budget on copies. Measure the duplicate ratio per site, here 2 of 3 example.com pages, and tune the rules site by site.

    example.com
    2 of 3 are copies

    What changed

    • Duplicate ratio measured per site
    • Link filter: rules per site

Space plays · ← → step · Home resets

THE IDEA

How it works

Resolve relative links against their source URL and normalize safe equivalents before enqueueing. Lowercase scheme and host, remove default ports and fragments (the part after #, which is never sent to the server), and apply a deliberate policy for query parameters and trailing slashes. For example, HTTP://Example.com:80/a/../b#top becomes http://example.com/b. Avoid aggressive rewriting: path case, parameter order, and even apparently tracking-like parameters can change a resource. Redirect targets and declared canonical URLs, a page’s hint about its preferred address, are useful signals, but do not erase the fetched URL’s history.

The URL-seen set prevents repeatedly queueing the same normalized URL. An 8-byte fingerprint for each of 10 billion URLs takes 80 GB before index overhead, so this set is a real capacity item.

Content hashes detect byte-identical pages reached through different URLs. A strong hash match is a cheap duplicate signal, but one changed timestamp gives a completely different SHA-256, so pages that differ only in boilerplate need a near-duplicate method. Google published work on using SimHash, a fingerprint where similar documents get similar values, for this purpose. Store URL-to-content relationships because duplicate content may still have distinct links, provenance, or future changes.

Both checks can err. Merge too eagerly and you lose real pages; merge too timidly and you spend fetch budget on copies. Measure the duplicate ratio per site and tune rules site by site.

DECISION POINT

Two URLs show identical HTML today. Should their URLs be discarded from crawl history?

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

Keep in mind

  • URL deduplication happens before fetching; content deduplication happens after.
  • Canonicalization is a product policy, not a license to merge every similar URL.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 2
RecallQUESTION 01

When can duplicate content be detected?

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.