28-10-2022 19:05

Hi everyone,

First sorry, I do not speak Dutch, so will have to write my question in English.

We've been encountering two bugs that might be related to Varnish with Woocommerce:
- requesting a lost password then clicking on the link in the email will redirect to the lost password form again (instead of the one to set a new password)
- it can happen that during checkout, the means of payment keep loading indefinitely (making it effectively impossible for the customer to submit their order)
- when a customer logs in their existing account from the checkout page, the current basket is replaced with an empty one.
The first two bugs never happen in Firefox, but happen in Edge (and probably Chrome though I haven't tested that myself).
The first one has a 100% chance off occuring, while the second one is more unusual - but once it's there, it's here to stay. We've added a button to send the request again in case it stays stuck, but it's an unelegant work-around.
The last one always happen, including in Firefox, so it might be related to a plugin of ours but we're not sure for now.

Otherwise, Varnish has been handling Woocommerce quite okay. So my questions are:
- does it seems like these behaviours could indeed be due to Varnish?
- how does the exclude command work?

The Woocommerce documentation indicates adding this code... somewhere, and that's about all the indication it gives:

if (req.url ~ "^/(cart|my-account|checkout|addons)") { return (pass); } if ( req.url ~ "\?add-to-cart=" ) { return (pass); }


We've tried adding some keywords in the exclude field (cart, my-account, addons, lost-password...), but we're unsure it works or if it's the correct way to do it (and it seems like it doesn't accept special characters, such as the "\?add-to-cart=").
Could you help us out?

Thank you.