When WP Rocket initiates a cache purge, the request passes through the web server to PHP‑FPM. If the PHP process stops unexpectedly, the server returns a 502 Bad Gateway response. The error appears immediately after you click Clear Cache in the admin area.
Typical triggers include a conflict with Query Monitor, a PHP‑FPM timeout, or insufficient workers. Corrupt cache files or a mis‑configured reverse proxy also cause the upstream response to be invalid.