scan
Ce contenu n’est pas encore disponible dans votre langue.
Probes one or more URLs to determine whether each response is cacheable per HTTP semantics (RFC 9111), whether it’s actually being cached, and how the fronting CDN/reverse proxy handles the cache key.
cache-detective scan --url https://example.com/Resource selection
Section titled “Resource selection”Exactly one of these must be set:
| Flag | Description |
|---|---|
--url | Single target URL to scan |
--list | Path to a newline-delimited list of URLs (#-prefixed lines are comments) |
--sitemap | URL of a sitemap.xml to scan (flat <urlset> only, not <sitemapindex>) |
--har | Path to a .har file to import GET/HEAD requests from |
--crawl | Crawl same-origin links starting from --url instead of scanning it alone |
Crawl-specific flags
Section titled “Crawl-specific flags”| Flag | Default | Description |
|---|---|---|
--path-prefix | (none) | Restrict --crawl to URLs under this path prefix |
--max-pages | 50 | Maximum pages to discover with --crawl |
--respect-robots | true | Honor robots.txt Disallow rules for * during --crawl |
cache-detective scan --url https://example.com/ --crawl --path-prefix /blog --max-pages 100Request configuration
Section titled “Request configuration”| Flag | Default | Description |
|---|---|---|
--method | GET | HTTP method to test |
--header | (none) | Custom request header "Name=Value" (repeatable) |
--cookie | (none) | Cookie "name=value" to send with every request (repeatable) |
--bearer | (none) | Bearer token for authenticated cache testing |
--auth-profiles | (none) | Path to a JSON file mapping target origin (scheme://host[:port]) to per-origin headers/cookies/bearer, overriding --header/--cookie/--bearer for matching resources |
--max-retries | 0 | Maximum retry attempts per probe request on transient failures (0 = no retries) |
--retry-delay | 500ms | Base delay between retry attempts (grows with backoff, honors Retry-After) |
--requests | 3 | Probe requests issued per resource for live cache-state detection |
--interval | 500ms | Delay between consecutive probe requests to the same resource |
--timeout | 15s | Per-request timeout |
--stale-window-max-wait | 30s | Maximum time to wait for a resource to enter its declared stale-while-revalidate window before giving up on actively confirming it |
--max-concurrency | number of CPUs | Maximum concurrent checks |
--max-resource-concurrency | number of CPUs | Maximum concurrent resources per check |
cache-detective scan --url https://example.com/account \ --bearer "$TOKEN" \ --cookie "session=abc123" \ --header "X-Api-Version=2"Per-target auth profiles
Section titled “Per-target auth profiles”--header, --cookie, and --bearer apply the same credentials to every resource in the scan. When a --list, --sitemap, --har, or --crawl run spans multiple hosts that each need different credentials, use --auth-profiles instead: a JSON file mapping each target’s origin to its own headers, cookies, and/or bearer token. A resource whose origin has no matching entry falls back to --header/--cookie/--bearer.
{ "https://api.example.com": { "bearer": "eyJhbGciOi...", "headers": { "X-Api-Version": ["2"] } }, "https://admin.example.com": { "cookies": { "session": "abc123" } }}cache-detective scan --list urls.txt --auth-profiles auth-profiles.jsonSecurity probing
Section titled “Security probing”| Flag | Default | Description |
|---|---|---|
--aggressive | false | Enable cache poisoning/deception probing |
--max-aggressive-requests | 10 | Hard cap on extra probe requests per resource for --aggressive checks (and the read-only vary-key check), even with --aggressive set |
cache-detective scan --url https://staging.example.com/ --aggressive--aggressive also gates stale-if-error confirmation — since confirming it means asking the origin to simulate a failure.
Output
Section titled “Output”scan shares its output/reporting flags with the rest of the CerberAuth CLI suite:
| Flag | Default | Description |
|---|---|---|
--format | terminal | Terminal display format |
--no-color | false | Disable ANSI colors in terminal output |
--quiet | false | Suppress terminal display of the report |
--output | (none) | File path to additionally write the report to |
--output-format | json | Format for --output |
--show-all-findings | false | Show every finding on stdout, not just active ones |
--report-url | (none) | HTTP endpoint to POST the report to |
--report-header | (none) | Additional HTTP headers for the report transport (key=value) |
--report-format | json | Format for --report-url |
cache-detective scan --url https://example.com/ --output-format json --output report.json --quietExit codes
Section titled “Exit codes”scan exits 1 if any check itself failed to execute (network errors, timeouts, …) and 0 otherwise — findings are reported but don’t affect the exit code on their own. To gate a build on specific findings, parse the JSON output (see the GitHub Actions guide) or use diff to detect drift against a baseline.