WordPress.org

Ready to get started?Download WordPress

Forums

Varnish HTTP Purge
[resolved] Incompatibility with WooCommerce (14 posts)

  1. jessor
    Member
    Posted 1 year ago #

    On a checkout page, after you make a payment, Woocommerce redirects you to /checkout/payment_received (or injects it through javascript).

    With Varnish HTTP Purge, this does not work. It shows:

    {"result":"success","redirect":"https:\/\/www.example.net\/cart\/payment-received\/?order=123456&key=order_50756a12345cf"}
    Error 404 Not cached
    Not cached
    
    Guru Meditation:
    XID: 12345678911

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

  2. jessor
    Member
    Posted 1 year ago #

    For anyone else getting here via Google: setting CURLOPT_RETURNTRANSFER to true seems to do the trick.

  3. lekiend
    Member
    Posted 1 year ago #

    Thank you Jessor for the info but where to set this option (in wich file ?).
    Sometimes it show the purging status from varnish on the frond-end.

    With "Varnishh HTTP Purge" plugin deactivated, redirect works perfect.

    Dimitri

  4. jessor
    Member
    Posted 1 year ago #

  5. lekiend
    Member
    Posted 1 year ago #

    Nice ;-)
    Thank you

    This link is also interesting:
    http://wcdocs.woothemes.com/codex/integration/configuring-caching-plugins/

    Dimitri

  6. pixeline
    Member
    Posted 1 year ago #

    Thanks a lot, very helpful. The plugin author should probably add this to the plugin core code...

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

    Posted 1 year ago #

    techpriester has given me commit access, so me and a coworker are testing out this and a different possible fix right now. Expect a new version shortly. :)

  8. Samantha
    Member
    Posted 1 year ago #

    Hello,

    With the latest update on Varnish HTTP Purge v2.0, is the Varnish configuration from WooThemes necessary? Thank you.

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

    Posted 1 year ago #

    I believe yes, it's still needed, Samantha. All we're doing is having WP tell Varnish to purge a cache when you have a new page. I'm double checking though!

  10. Samantha
    Member
    Posted 1 year ago #

    Cool. Let me know when you've had the chance to double check. Thank you!

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

    Posted 1 year ago #

    So my smarter coworker says "The second part you shouldn't need, but the first part yes, since you need to tell Varnish what to ignore."

  12. Samantha
    Member
    Posted 1 year ago #

    OK. Where should be the code be added?

    if (req.url ~ "^/(cart|my-account|checkout|addons)") {
     return (pass);
     }
    if ( req.url ~ "?add-to-cart=" ) {
     return (pass);
     }
  13. Ipstenu (Mika Epstein)
    Half-Elf Support Rogue & Mod
    Plugin Author

    Posted 1 year ago #

    Wherever your varnish config files live.

  14. Samantha
    Member
    Posted 1 year ago #

    Great. Will see how this works. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic