You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- add --dedupePagesMinDepth to enable page-level dedupe at certain depth
or greater
- add 'duplicate' as another skip reason, log skip reason when page is
skipped due to dedupe
- when pageDedupe is enabled, set pageLimit to 0 and allow queueing
pages beyond expected limit, in case pages are skipped
- add queuePageLimit and check limit on each new page at queue pop time,
allows skipping already deduped pages and incrementally crawling new
pages
- when limit reached, queued pages are drained and marked as excluded /
logged to skippedPages list
- tests: test page dedupe / incremental crawling: new pages are archived
on subsequent crawls, previous pages skipped with 'duplicate' reason
- docs: add Page Deduplication on dedupe page
- docs: add Reports page (reports.md), document skipped pages /
--reportSkipped report
- fixes#1017
---------
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Copy file name to clipboardExpand all lines: docs/docs/user-guide/dedupe.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,28 @@ This operational is not required - the data from the interrupted crawl will not
115
115
simply free up the data on the Redis.
116
116
117
117
118
+
## Page Deduplication
119
+
120
+
The crawler also has the option to skip loading of entire pages if the page HTML is a duplicate.
121
+
122
+
In such cases, after the `revisit` record for the HTML page is written, the crawler aborts loading the page in the browser and moves on to the next page.
123
+
124
+
This allows saving not only storage but crawling time, as duplicate pages are quickly skipped by the browser.
125
+
126
+
Note that there is a trade-off involved, as any page resources (images, stylesheets) or links are also skipped and are not crawled, even if they may have changed.
127
+
128
+
To enable this feature, set the `--dedupePagesMinDepth` to a value of 0 or greater.
129
+
Setting to a value of 0 means that even the seed page will be skipped if it has not changed, and no additional pages will be crawled.
130
+
131
+
It is generally recommended to set `--dedupePagesMinDepth` to a value of at least 1 when using this feature. Setting to a value of 1 will ensure that the seed page is always fully crawled and that its links will be added to the crawl queue. Pages one link away from the seed and at greater depths will be loaded and then skipped if they are unchanged.
132
+
133
+
134
+
### Incremental Crawling
135
+
136
+
When duplicate pages are skipped they do not count towards the page limit, and additional pages can be crawled up to the page limit. This approach can be used to crawl a site that hasn't changed incrementally, a few pages at a time.
137
+
138
+
For example, if a site has 100 pages, a home page and 99 other static pages that don't change, it can be fully crawled after 11 crawls with the setting `--dedupePagesMinDepth 10 --pageLimit 10`, which will crawl the home page and up to 9 additional pages each time the crawler is run.
139
+
118
140
## Deduplication outputs
119
141
120
142
When deduplication is enabled, the crawler output is changed in the following ways (in addition to using
@@ -135,5 +157,9 @@ file(s) contain the WARCs with `response` records for each `revisit` record that
135
157
This allows for tracking which WACZ files are required by other WACZ files to get the full archived content.
136
158
See the [WACZ dependency section of the developer documentation](../develop/dedupe.md#crawl-dependency-tracking-in-wacz-datapackagejson) for more details on the architecture of this dependency system.
137
159
160
+
### Reporting
161
+
162
+
If both page deduplication and [skipped page reporting](./reports.md) are enabled, pages that are skipped due to page deduplication are logged with the `duplicate` reason.
163
+
138
164
## Deduplication system architecture
139
165
See the [developer docs for dedupe](../develop/dedupe.md) for more advanced information of the architecture of the dedupe system.
Copy file name to clipboardExpand all lines: docs/docs/user-guide/outputs.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,23 @@ Browsertrix Crawler crawl outputs are organized into collections, which can be f
9
9
Each collection is a directory which contains at minimum:
10
10
11
11
-`archive/`: A directory containing gzipped [WARC](https://www.iso.org/standard/68004.html) files containing the web traffic recorded during crawling.
12
+
-`downloads/`: A directory containing any resources the crawler downloaded to run the crawl, such as browser profiles or behaviors.
12
13
-`logs/`: A directory containing one or more crawler log files in [JSON-Lines](https://jsonlines.org/) format.
13
14
-`pages/`: A directory containing one or more "Page" files in [JSON-Lines](https://jsonlines.org/) format. At minimum, this directory will contain a `pages.jsonl` file with information about the seed URLs provided to the crawler. If additional pages were discovered and in scope during crawling, information about those non-seed pages is written to `extraPages.jsonl`. For more information about the contents of Page files, see the [WACZ specification](https://specs.webrecorder.net/wacz/1.1.1/#pages-jsonl).
14
-
-`warc-cdx/`: A directory containing one or more [CDXJ](https://specs.webrecorder.net/cdxj/0.1.0/) index files created while recording traffic to WARC files. These index files are
15
+
-`profile/`: A directory containing the current browser profile, either new or loaded from a saved profile.
16
+
-`crawlIds/`: A directory containing a single `crawlIds.txt` file which lists the identifiers of all crawls included in this collection.
17
+
-`warc-cdx/`: A directory containing one or more [CDXJ](https://specs.webrecorder.net/cdxj/0.1.0/) index files created while recording traffic to WARC files. These index files contain entries for every WARC record written and are updated
18
+
at the same time as the WARCs.
19
+
15
20
16
21
Additionally, the collection may include:
17
22
18
23
- A WACZ file named after the collection, if the `--generateWACZ` argument is provided.
19
24
- An `indexes/` directory containing merged [CDXJ](https://specs.webrecorder.net/cdxj/0.1.0/) index files for the crawl, if the `--generateCDX` or `--generateWACZ` arguments are provided. If the combined size of the CDXJ files in the `warc-cdx/` directory is over 50 KB, the resulting final CDXJ file will be gzipped.
20
25
- A single combined gzipped [WARC](https://www.iso.org/standard/68004.html) file for the crawl, if the `--combineWARC` argument is provided.
21
26
- A `crawls/` directory including YAML files describing the crawl state, if the `--saveState` argument is provided with a value of "always", or if the crawl is interrupted and `--saveState` is not set to "never". These files can be used to restart a crawl from its saved state.
27
+
- A `reports/` directory containing various reports generated during the crawl. See [Reports](reports) for more info.
Browsertrix has the option to generate optional reports with each crawl. The following reports are currently available.
4
+
Browsertrix has the option to generate optional reports with each crawl. All reports are in the JSONL format, with one JSON entry per line. The following reports are currently available.
5
+
6
+
## Skipped Pages Report
7
+
8
+
Written to `reports/skippedPages.jsonl` and enabled with `--reportSkipped`, this report is in the same format as the `pages/pages.jsonl` file, but lists pages that were either never loaded or where page loading was immediately aborted and no content was archived from that page.
9
+
10
+
Each line in the report contains the following:
11
+
12
+
-`url`: Page URL
13
+
-`ts`: The ISO Date of the time the page was encountered
14
+
-`seedUrl`: The seed URL that this page was discovered from
15
+
-`depth`: The depth of the page if it were to be crawled
16
+
-`seed`: true|false if the page is a seed
17
+
-`reason`: Reason for skipping this page
18
+
19
+
### Skip Reasons
20
+
21
+
The `reason` may be one of the following:
22
+
23
+
-`outOfScope`: Page URL out of scope according to scoping rules
24
+
-`pageLimit`: The limit `--pageLimit` was reached before the page could be crawled
25
+
-`robotsTxt`: The page URL has been excluded via robots.txt rules
26
+
-`redirectToExcluded`: A special case of `outOfScope` where the page URL itself is in scope but loading it resulted in a HTTP redirect to a page that was not in scope, so page loading was aborted
27
+
-`duplicate`: The page content is a duplicate and loading was aborted (see [Page Deduplication](./dedupe.md#page-deduplication) for more information)
0 commit comments