# Reproduce the live content-monitoring case

These downloads accompany the case at https://ipvolt.com/blog/etag-monitoring-cache-control. The observed subject is ipvolt's public website, not an available ipvolt proxy service. Connection-provider identity, credentials and exit IPs are omitted.

## Recompute the published numbers offline

Download `reproduce.py`, `recordings.zip` and `results.json` into the same directory. Python 3.10+ is sufficient; this command performs no network requests:

```sh
python3 reproduce.py recordings.zip
```

Its JSON output must equal `results.json`, including the archive hash. The recordings include selected response headers, timestamps, decoded/body hashes, exact declared assertions and all attempted/skipped rows for three completed experiments. Private raw headers/bodies are not included. Arithmetic replay is not independent authentication of historical responses.

## Exact live collection programs

Download all three helpers together because the latter two import `http_study.py`:

- [http_study.py](https://ipvolt.com/downloads/content-monitoring/http_study.py)
- [cache_sequence.py](https://ipvolt.com/downloads/content-monitoring/cache_sequence.py)
- [header_probe.py](https://ipvolt.com/downloads/content-monitoring/header_probe.py)
- [main-study.json](https://ipvolt.com/downloads/content-monitoring/main-study.json)
- [sequence-study.json](https://ipvolt.com/downloads/content-monitoring/sequence-study.json)
- [header-study.json](https://ipvolt.com/downloads/content-monitoring/header-study.json)

Use Python 3.10+ and curl 8.4+. Each configuration contains a bounded request/body budget and an explicit endpoint allowlist. The programs only accept canonical ipvolt.com HTTPS paths; adapt that explicit host rule and content assertions for another property you operate. Existing run directories are refused. Completion of collection is not an all-checks-passed verdict: inspect the report's statuses, failures and unknown values.

The recorded configurations include proxy contexts. Supply your own private mode0600 JSON file, referenced through `IPVOLT_STUDY_SECRETS`, with this shape (the example values are placeholders, not credentials):

```json
{"contexts":{"us":{"server":"http://YOUR_GATEWAY:PORT","username":"YOUR_US_ROUTE","password":"YOUR_SECRET"},"gb":{"server":"http://YOUR_GATEWAY:PORT","username":"YOUR_GB_ROUTE","password":"YOUR_SECRET"},"nl":{"server":"http://YOUR_GATEWAY:PORT","username":"YOUR_NL_ROUTE","password":"YOUR_SECRET"}}}
```

```sh
export IPVOLT_STUDY_SECRETS=/absolute/path/to/private-contexts.json
python3 http_study.py collect main-study.json new-main
python3 cache_sequence.py sequence-study.json new-sequence
python3 header_probe.py header-study.json new-header-probe
```

These are live network commands. Credentials pass through curl's standard input, not command arguments or published output. Keep raw run directories private. To run a direct-only variant, change `contexts` to `[{"id":"direct","country_requested":null}]`; it does not require proxy credentials, and its results are a new experiment rather than a recreation of geographic observations.

The initial runner seeds each paired unit, then conditionally revalidates and makes a full verification request. It has no Cache-Control override. The persistent sequence includes one cold seed and four subsequent checks per route/context and sends `Cache-Control: no-cache` each time. The final probe holds each seed ETag fixed and uses balanced A/B/B/A or B/A/A/B requests. The policies have different cache semantics; no program proves origin contact or implements freshness-based local reuse.

## Offline fixture tests

Download `test_http_study.py`, `test_cache_sequence.py`, `test_header_probe.py` and `study.json` beside the helpers. `study.json` is the editable starter used by synthetic tests, not the executed study manifest.

```sh
python3 -m unittest discover -s . -p 'test_*.py' -v
```

All27 tests passed. They cover cache provenance, body changes, unsupported validators, failures, unknown byte measurements, private transport, budgets and the controlled header ordering. Fixture results are separate from the real observations in `recordings.zip`. See `test-results.txt` and `method.json` for the captured test output and actual collection scope.

Full body-byte measurements exclude HTTP headers, TLS/TCP/proxy overhead and billing. The Markdown responses allowed max-age300 reuse; a client whose freshness needs allow a local cached response may avoid a network request. We measured neither an invoice nor revenue or detection latency.
