Skip to content

Incremental Updates

Harsimran Sidhu edited this page Jul 15, 2026 · 1 revision

Incremental Updates

--update lets you refresh an existing mirror without re-downloading resources that have not changed, using HTTP ETag and Last-Modified metadata.

How it works

  1. On the first run with --update, the tool records each saved resource's ETag and Last-Modified values in a cache file.
  2. On later runs, it sends If-None-Match / If-Modified-Since request headers.
  3. If the server replies 304 Not Modified, the local copy is reused and counted as cached.
  4. If the resource changed, it is re-downloaded and the cache entry updated.

Known pages and assets are re-seeded from the cache each run, so an update crawl revalidates everything it mirrored previously — not just what it can rediscover from links.

Usage

website-downloader --url https://example.com --destination example_backup --update

Custom cache location:

website-downloader --url https://example.com --destination example_backup \
  --update --cache-file .cache/example.json

The cache file

  • Default location: DESTINATION/.website-downloader-cache.json
  • It is plain JSON: a version marker plus one entry per URL (path, kind, status code, ETag, Last-Modified).
  • --cache-file requires --update; using it without --update is rejected.

Good to know

  • If the local mirror file is missing but the server returns 304, the tool refetches it in full instead of writing an empty file.
  • Servers that do not send ETag or Last-Modified cannot be skipped — those resources are simply re-downloaded.
  • Deleting the cache file forces a full re-mirror on the next run.

See also: CLI Reference, How It Works.

Clone this wiki locally