check_circleWP RocketcodePHPhourglass_bottomTimeoutwarningcachesettingsserver_configurationrocketwp_rocketstar_halfUncommonwarningModerate

Updating menu and widgets, and WP Rocket->Clear cache results in 502 timeout

When WP Rocket initiates a cache purge it walks through the cache directory and removes each file. If the folder contains millions of files or several gigabytes of data the removal process runs for many seconds. The PHP request exceeds the configured execution time and the web server aborts the connection, returning a 502 Bad Gateway response.

Server timeout settings, slow disk I/O, restrictive file permissions, or a second plugin that also triggers the purge can extend the operation further. The combined load pushes the request past FastCGI or reverse‑proxy limits, which also produces the 502 error.

Symptoms

[dashicons-warning]
502 Bad Gateway after save
Admin screen shows 502 after clicking Update Menu or Clear Cache
[dashicons-clock]
Admin hangs
Interface pauses for two minutes before error appears
[dashicons-no]
Changes not saved
Menu or widget modifications revert to previous state

Common Causes

Huge cache size
Cache folder exceeds several gigabytes and hundreds of thousands of files
Server timeout limits
FastCGI, Nginx or reverse‑proxy abort request after default 120 seconds
Plugin conflict
Another plugin (e.g., Query Monitor) hooks into rocket_clean_domain and triggers a second purge
Slow disk I/O or permission issues
File system struggles to delete files quickly, causing repeated retries
Need this fixed right now?

Don't waste your day debugging. Our experts can Fix your issues in under 2 hours.*

Success Rate

100% Guaranteed

Starting from

$35 /hour
99+

Trusted by Business Owners

“I spent 3 days trying to fix the Elementor loading loop. These guys fixed it in 20 minutes. Lifesavers!”

— Sarah J., Web Designer

Related Issues

contact_mail
Contact Form 7: REST API request failed: 503 Service Unavailable
A 503 Service Unavailable response stops Contact Form 7 from sending data...
apiREST APIerror503descriptioncontact-form-7
contact_mail
Contact Form 7: REST API request failed: 429 Too Many Requests

The form tries to send data through the WordPress REST API. The...

apiREST APIerrorerrorsecurityfirewalldescriptioncontact-form-7settingsserver_configuration
contact_mail
Contact Form 7: REST API request failed: 401 Unauthorized

The form tries to send data via the WordPress REST API. The...

apiREST APIadmin_panel_settingspermissionsdescriptioncontact-form-7lock401
contact_mail
Contact Form 7: File upload error: temporary directory missing

The error appears when Contact Form 7 cannot locate a writable temporary...

codePHPcloud_offupload erroradmin_panel_settingspermissionsdescriptiontemporary filedescriptioncontact-form-7
contact_mail
Contact Form 7: Mail (2) sending failed: PHP mail() function disabled

Contact Form 7 reports a failure for Mail (2) when the PHP...

codePHPerrorerrordescriptioncontact-form-7mailMailsettingsserver_configuration
contact_mail
Contact Form 7: Mail (2) sending failed: SSL certificate verification failed

Contact Form 7 reports a failure when trying to send the secondary...

errorerrorlocksslcodecURLdescriptioncontact-form-7