Support » Plugin: Cloudflare » Automatic cache purge API errors

  • Resolved salubritas

    (@salubritas)


    Every time I save a post the plugin attempts to purge the Cloudflare cache (as intended) but logs an error in the PHP log:

    2020/06/13 15:20:05 [error] 121024#121024: *2058760 FastCGI sent in stderr: "PHP message: [Cloudflare] ERROR: [CLIENT API] Array
    (
    [type] => response
    [body] => Array
    (
    [result] =>
    [success] =>
    [errors] => Array
    (
    [0] => Array
    (
    [code] => 1084
    [message] => Unable to purge , which is an invalid URL.
    )
    [1] => Array
    (
    [code] => 1016
    [message] => One or more cache purge errors
    )
    )
    [messages] => Array
    (
    )
    )
    )" while reading response header from upstream, client: 90.255.184.151, server: www.mysite.com, request: "POST /wp-admin/post.php?post=25331&action=edit&meta-box-loader=1&meta-box-loader-nonce=bea5f1ef28&_locale=user HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-mysite.sock:", host: "www.mysite.com", referrer: "https://www.mysite.com/wp-admin/post.php?post=25331&action=edit"

    It looks like it is sending an empty URL to the purge API.

    I've taken a cursory look at the code and followed it through to getPostRelatedLinks but not digged deeper. Any ideas on this? Is it a known issue?

Viewing 1 replies (of 1 total)
  • Thread Starter salubritas

    (@salubritas)

    I found that I needed to customize the URLs to purge quite heavily anyway, due to custom post types, hierarchical taxonomies etc. so I fixed this error while I was doing it. Think it was due to comment feeds being turned off or similar.

    All via the provided filter cloudflare_purge_by_url.

Viewing 1 replies (of 1 total)
  • The topic ‘Automatic cache purge API errors’ is closed to new replies.