WordPress.org

Ready to get started?Download WordPress

Forums

Varnish HTTP Purge
[resolved] Error in XMLRPC calls (2 posts)

  1. b3cft
    Member
    Posted 1 year ago #

    Hi,

    I had a problem with 1.2.0 when using xmlrpc to update a post that wasn't in the varnish cache.

    Varnish returned an error in the curl response to purge the page.
    The curl in your extension echo's the error back to the client, which then gets appended to the client's xmlrpc response, but invalidates the xml.

    Quick fix. Enable curl return transfer to prevent the echo back to the browser.

    In file varnish-http-purge/varnish-http-purge.php

    protected function purgeUrl($url)
    {
    $c = curl_init($url);
    curl_setopt($c, CURLOPT_CUSTOMREQUEST, 'PURGE');
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    curl_exec($c);
    curl_close($c);
    }

    http://wordpress.org/extend/plugins/varnish-http-purge/

  2. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 1 year ago #

    Try version 2.0, we've tweaked that :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.