CDN
CDN control-plane. Multi-provider (cloudflare | cloudfront | fastly | direct | stub). Cloudflare purge is capped at 30 URLs/call and requires CLOUDFLARE_ZONE_ID + CLOUDFLARE_API_TOKEN (env-only); absent creds fall back to 'direct' mode (no upstream purge call, never raising). generate_cache_key = sha256 first-32 hex of url + sorted vary headers.
- Group: Content & media
- Contract:
contracts/cdn/v1/openapi.yaml - Public access: none — internal-only capability. It is NOT exposed on the public API gateway (
https://api.vagarylabs.com); it is reachable only inside the fleet (container/tailnet) by first-party callers. There is no customer-facing endpoint to call.
Endpoints
| Method | Path | Summary |
|---|---|---|
GET | /health | liveness + provider (open) |
GET | /metrics | Prometheus text (open) |
POST | /v1/cdn/purge | purge CDN cache (by paths, capped 30/CF-call, or purge_all) |
POST | /v1/cdn/configure | set provider + base_url (cloudflare without creds falls back to direct) |
GET | /v1/cdn/stats | provider + recent purge stats |
GET | /v1/cdn/url-rewrite | the CDN URL for an asset path |
GET | /v1/cdn/cache-key | sha256[:32] cache key for a url + sorted vary headers |
Schemas
No inline component schemas in this contract.
Generated by scripts/gen-capability-docs.py from contracts/cdn/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.