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.
Two URLs show identical HTML today. Should their URLs be discarded from crawl history?
No. Reuse or deduplicate stored content if appropriate, but retain each URL and its fetch history because links, ownership, or content can diverge later.
Use this as a guide for self review; written answers are not graded.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.