Hybrid Mode
Hybrid mode prefers fresh runtime data and falls back to bundled archives when a live source cannot be used safely.
php
'mode' => env('EDGE_TRUST_MODE', 'hybrid'),Resolution order (per provider)
- Return cached ranges if the cache entry is still valid
- Attempt a runtime fetch from the official (or configured) source
- Validate the payload (non-global, non-empty, checksum rules)
- On success: store in cache (and optionally refresh local archive via sync)
- On failure: use the bundled / last-known-good archive for that provider
Failure scenarios
| Scenario | Hybrid behavior |
|---|---|
| Provider HTTP timeout | Fall back to archive |
| Invalid CIDR in response | Fall back to archive; do not cache bad data |
| Global range in response | Fall back to archive |
| Empty response | Fall back to archive |
| Cache warm | Serve cache; no fetch |
Operational guidance
- Keep archives reasonably fresh with a daily
edge-trust:synceven in hybrid mode, so fallbacks are not weeks out of date. - Monitor sync failures — silent prolonged fallback means ranges may lag provider changes.
- Pair hybrid mode with origin firewall allowlisting so temporary archive lag does not become an open proxy trust issue at the network layer.
Compared to other modes
- Stricter offline posture → use
bundled - No archive fallback desired → use
runtime(accept outages impacting refresh) - Default recommendation for production behind a CDN →
hybrid