learn / Term explained
EN

Collection basics · Terminology explanation

Request deduplication

Request deduplication

Common writing methods: duplicate requests, request fingerprints, URL deduplication

What it means

Recognizing previously seen tasks when scheduling requests, to avoid repeatedly visiting the same resource through link cycles or duplicate discovery.

Whether it is considered a duplicate or not depends on the identity rules used by the task. In addition to the URL, the request method, request body, and other state required by the task may also affect whether the request represents the same resource.

Requesting deduplication and final record deduplication are two stages. Even if it is requested only once, a page may contain duplicate data; conversely, two different URLs may correspond to the same business record.

For Scrapy’s default RequestFingerprinter, inputs normally include the canonicalized URL, request method and body; headers and URL fragments are excluded by default. Since 2.20.0, download_handler also matters when it differs from the URL scheme, while verbatim_url=True skips URL canonicalization. A fingerprint is therefore not simply the raw URL string.

For example, reordering the same query parameters normally describes the same request, while different POST bodies at the same URL normally differ. If sessions or headers change the content, explicitly choose custom fingerprint rules, using include_headers or keep_fragments when appropriate. Keeping a fragment does not execute JavaScript. Focused review: 2026-11-20.

In a scraping task

Prevent list linking from forming a cycle

When multiple category pages are linked to the same details page, the scheduler can use request fingerprints to avoid repeated enqueuing. When data is output, duplicate records are checked based on business primary keys such as product IDs.

Common misconceptions

  • Only removes duplicates of URL strings, not necessarily covering POST requests or tasks with different parameter meanings.
  • Requesting deduplication cannot replace field cleaning and business data deduplication.

References

Organized by Northleaf Studio. The source link retains the original address to facilitate continued reading.

Back to glossary