Skip to content

Opt-in storage of fetched JS bundles in the content store for corpus and research runs #1255

Description

@nc9

Problem

For large research and corpus runs (labelling, training data, re-running new rules without re-crawling), the CLI keeps HTML in the content store and page metadata in the project DB, but never stores JavaScript bundles. Re-analysing a crawl later, for new secret rules, new tech fingerprints or labelling, means fetching everything again. That's slower, it adds load on sites, and bundles have often changed by then.

Expected

An opt-in [storage] store_scripts = true (plus a matching CLI flag) that keeps every fetched first-party script body in the content store:

  • deduplicated by content hash (shared vendor chunks stored once)
  • with a per-file cap (default e.g. 2 MB) and a total cap tied to content_store_max_bytes
  • linked from the page record (script URL to content hash), so offline tools can rebuild "page + its bundles"

It's off by default, since bundles are large. Retention and self disk --prune treat stored scripts like stored HTML.

Acceptance Criteria

  • With store_scripts = true, every first-party script the crawl fetched is retrievable from the content store by URL for that crawl
  • Identical bundles across pages and sites are stored once
  • Per-file and total caps are enforced; oversized scripts are recorded as skipped, with their size
  • With the default (off), nothing changes in storage size or behaviour
  • Docs (configuration, storage) describe the option and its disk cost

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementsize: M

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions