The request path
- A request reaches PHP-FPM or Exponential Velocity.
- Before the kernel, its autoloader and the database start, config.php runs the shield's hook.
- The shield checks the request in a fixed order: hard checks, host names, blocked paths, forms, areas for some addresses, attack patterns, then the visitor's pace and the browser check.
- A request that passes goes on to Exponential, and to its HTTP cache only if the shield marked it cacheable.
- A request that does not pass is answered by the shield itself: 403, 404, 405, 429 or the browser check page.
Fast enough to forget about
A passing request costs about 12 microseconds with APCu and about 42 with plain files, the shared hosting norm. The rule files are compiled once and kept for OPcache. Compared to a page that takes 100 to 200 ms to build, the shield is free; compared to a refused request reaching the kernel, it saves almost all of the work.
Budgets per visitor
A visitor is an IPv4 address or an IPv6 /64. Each has budgets: requests per minute, searches, sign-ins, image aliases. Above a threshold the visitor is asked for the browser check; above the limit the shield answers 429 Too Many Requests with Retry-After. Behind a load balancer or Cloudflare, X-Forwarded-For is believed only from the proxies you trust.
Fail safe
- Whatever breaks inside the shield, a store it cannot write or a hook that throws, the request reaches your site, marked uncached, and PHP's error log gets one line a minute.
- A rule file that does not compile after a deploy leaves the last good rules in force.
- The installation's own requests (the preloader, the checks after an upgrade, static publishing) are signed with a key only the installation has, so they are never refused.
More detail: How it works, in the extension's documentation.