Please note that this error is only occurring with:
FPM application served by Apache.
Proxy Mode enabled.
If I bypass Apache by disabling Proxy Mode and using “Dedicated FPM application served by nginx”, I don’t see the error.
Plugin Contributor
iSaumya
(@isaumya)
Hi @wykananda,
I understand your problem, but setting "no-cache, no-store, must-revalidate, max-age=0
cache control header value for wp-cron.php
requests are needed to ensure that those requests are never cached by Cloudflare CDN edge.
If the server level rule is causing issue, then I would suggest implementing the rule using Cloudflare Transform Rules. There you can go in the option of modify Response Header and then create a rule saying ->
if hostname equals to example.com
(whatever your website domain is) and URI Path starts with /wp-cron.php
then add the cache-control
header with the value no-cache, no-store, must-revalidate, max-age=0
.
In this way the entire header manipulation will happen on edge and you don’t need to have a server level rule for that.
Hi @isaumya,
Thanks for your help. Setting up a Transform Rule indeed did fix the loopback error. However, it seemed like perhaps the issue was deeper. I was seeing intermittent 504 errors being reported when updating wordpress pages in the editor. The update would timeout after 45 seconds or simply just take an awful long time to complete. I was going crazy trying to track down the cause.
When checking the PHP-FMP log, there was an error:
PHP Fatal error: Uncaught Error: Call to undefined function opcache_get_status() in /var/www/vhosts/katog.org/stage.sub/wp-content/plugins/wp-cloudflare-page-cache/libs/cache_controller.class.php:3157"
I did a search in your forum and found this reference:
https://wordpress.org/support/topic/swcfpc_cache_purge_cron-error/
suggesting to turn off “Automatically purge the OPcache when Cloudflare cache is purged”.
Turning that option off made the PHP-FPM error go away. And it seemed to correct both the intermittent 504 error (yipee!) and the Loopback error too.
However, I do have OPCache enabled on the Plesk server. So, would you know what would be causing “opcache_get_status()
” error and how to correct it so the OPCache purge works? I’m assuming I would want “Automatically purge the OPcache when Cloudflare cache is purged” enabled and working if it’s in use on the server.
Thanks for your help! A great plugin 🙂
Plugin Contributor
iSaumya
(@isaumya)
Hi,
The opcache_get_status
is a PHP Function: https://www.php.net/manual/en/function.opcache-get-status.php – not sure why it is not available in Plesk. If it is not available in your system, you can disable that option inside the plugin.