Varnish Breaks Woocommerce and Breeze breaks Amazon ads


#1

Hi
After lots of testing and fiddling about and making sue everything is updated to the latest versions I found 2 problems,
First, Enabling Varnish on my WordPress app breaks Woocommerce cart and it becomes “always empty” even though the popup confirms a product was added to the cart.

Second, Enabling Breeze plugin prevents Amazon Native ads from appearing except for the administrator.

So the way I solved the two problems, first was by adding exception for all woocommerce pages to varnish and the second by completely disabling Breeze.
Both are more like workarounds and I am not happy with either…

Please help


#2

Yep, Varnish can break WooCommerce. I had to disable it, too, after two long support tickets about it.

In my case, I am able to run Breeze, and FORTUNATELY the site runs as quickly as it did with Varnish. (W3TC was NO help.)

This is a site that I moved over from SiteGround. SG’s server-side caching had no problems. Happily, the site is still faster on CW.


#3

Did you have to configure Breeze to work with WooCommerce? Or does it work out of the box?


#4

You need to exclude some cookies for Varnish


#5

Hi @orlando

If you want Varnish + Breeze to work with WooCommerce stores, then you should launch WooCommerce application on the server.

The WooCommerce application contains all the settings that are required to make cache work without any problem.


#6

Sorry but that’s not true…My application is setup as Woocommerce and still Breeze and Varnish are causing the above mentioned problems.


#7

I managed to get Varnish+Breeze and WooCommerce working correctly by going to your CW server -> app -> application settings -> Varnish.

Add these:

Cookie
Exclude
woocommerce_items_in_cart

Cookie
Exclude
woocommerce_cart_hash

Cookie
Exclude
woocommerce_recently_viewed

Cookie
Exclude
wc_session_cookie_HASH

Also exclude URLs (adjust these to your shop’s URLS for cart and checkout).

  • cart *
  • checkout *
    (You can use wildcards * )

Don’t forget to purge Varnish cache.


#8

It doesnt break woo. It just needs adjustment to work. Create a varnish rule to exclude woo.


#9

Add to info19:

URL Exclude ?add-to-cart=
URL Exclude ^/(cart|my-account/|checkout|wc-api/|addons|logout|lost-password|product/*|wp-admin|wp-login)
Cookie Exclude woocommerce_cart_hash
Cookie Exclude woocommerce_items_in_cart
Cookie Exclude wp_woocommerce_session_

Optional Rules for WordPress:

Value
Cookie Exclude wp-settings-\d+=[^;]+(; )?
Cookie Exclude wp-settings-time-\d+=[^;]+(; )?
Cookie Exclude
wordpress_test_cookie=[^;]+(; )?
Cookie Exclude wordpress_logged_in


#10

The first site I had this problem on was multisite, so that sort of counts as two, but I’ve just had my second incident (new application) with WooCommerce and not being able to log in while Varnish is enabled. It always goes this way: I create a ticket because “x-cache: MISS” is returned for each page; they fix this, but now nobody can log in; so I have to disable Varnish completely.


#11

Hello,

Can you confirm that everything is ok now ? Woocommerce stores on Cloudways are faster ?

Thank you.


#12

Seems like something may have changed, I’ve recently migrated to Cloudways and my Woocommerce sites are fully functional even without any settings applied to the Varnish tab at all.


Varnish & OptimizePress/s2member Issue