White screen while clearing the cache
In rare occasions, you may see a white screen when clearing the cache of WP Rocket by:
- Using the Clear and Preload cache option in WP Rocket's admin bar menu.
- Clicking on the Clear cache button in WP Rocket's admin notices.
- Clicking on the Clear and Preload cache button in WP Rocket's Dashboard tab.
- Using the Clear this cache option in the list of pages/posts.
In the rest of this article, you will find the possible issues and solutions to this problem.
Lack of memory
The action may fail if the website runs out of PHP or physical memory.
To fix this, please check if the PHP error log has entries such as: Fatal error: Allowed memory size of 157286400 bytes exhausted
. In this case, you should try increasing the PHP memory.
If there are no related PHP logs, make sure your hosting plan has enough available physical memory.
Content Security Policy
The cache purge request may fail depending on the Content Security Policy (CSP) settings of a website. To be specific, if the /wp-admin
pages use the no-referrer
value for the referrer-policy
header.
When this issue happens, there are no PHP errors logged.
To solve this, you need to exclude the /wp-admin
pages from this rule. The /wp-admin
pages should use the strict-origin-when-cross-origin
value instead.
502 error when clearing the cache
If you see a 502 error from Cloudflare when clearing the WP Rocket cache, you're getting another issue. In that case, please refer to the 502 error when manually clearing the cache article instead.