Issue with woocommerce + cache


#1

Hi guys.

I’m running an ecommerce site powered by wordpress and woocommerce on a linode vps, however, there is something pretty strange. I turned off all of my cache plugins (W3 total and Wordfence) but my shopping cart page and check out page still got cached and show previous session instead of current session. I also created a file named “woo-nginx.conf” just like the tutorial here: Woocommerce and redis cache method but still no use. Would u guys plz help me to figure it out. Thanks in advance.


#3

hey @Duy_Anh_Hoang

we need to isolate the problem first.

you have disabled all cacheing plugins, thats good. can you also disable woocom, restart php, then activate woocom again, and see if the page is still cached? another way of doing this is, to create a new page, and change the cart page from old_page to new_page and see if the cacheing still continues?

it maybe that there are some transient (parts of configs that should have been deleted but weren’t) still present on the system.

let us know how you get along.

mahir


#4

Hi, mahir. Sorry for the late reply, summer holiday, u know :smiley: My problem is so weird, as it comes and goes and comes again while I have exactly no idea what caused it. The problem is very similar to the one here: Config nginx file for fastcgi cache & Woocommerce;

Let me describe my situation:

  1. I created a wp site with easy engine. Main plugins are woocommerce, w3 total cache, nginx helper.

  2. I usually use loader.io tool to stress the site and check the efficiency of cache plugin.

  3. I found out that my site keep showing cached session, like a blank cart page or old products in cart, inspite of adding new ones. And this cached cart page is showing across platform and browsers. For instance, when I added a new product in PC-Chrome, it shows up even in PC-Firefox or Mobile-Chrome, etc. Clear cache from both nginx helper and w3 won’t help. Nothing changes.

  4. I tried to turn off both nginx helper and w3 total, then added following line to my nginx.conf:

set $skip_cache 0;
                # POST
requests and urls with a query string should always go to PHP
                if
($request_method = POST) {
                                set
$skip_cache 1;
                }   
                if
($query_string != "") {
                                set
$skip_cache 1;
                }   
                if (
$cookie_woocommerce_items_in_cart = "1" ){
                                 set $skip_cache 1;
                }
                # Don't
cache uris containing the following segments
                if
($request_uri ~*
"/shop.*|/cart.*|/my-account.*|/checkout.*|/addons.*|/wp-admin/|/xmlrpc.php|wp-.*.php|index.php")
{
                                set
$skip_cache 1;
                }   
                # Don't
use the cache for logged in users or recent commenters
                if
($http_cookie ~*
"comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in")
{
                                set
$skip_cache 1;
                }

But the problem still there, nothing happened.

  1. After few days, I came back and found out that my site was back, working perfectly, so I made a backup to ensure I will can freely test it without worring.

  2. I turned on all my cache plugins, still working fine, no problem. I thought I couldn’t be happier. Then I use loader.io again to test and the problem showed up again. So I thought that I discovered how it appears.

  3. I created a brand new VPS after that and restore the backup mentioned above, but surprisingly, the problem is still there (on a brand new vps, without load test).

  4. I have just turned off everything again and waiting now to see if it would disappear.


#5

Version 3.7.1 of EasyEngine merged a cache update that was supposed to fix this, provided by Backenkoehler and committed from pull request #745.

Are you sure you have the latest version of EE installed? If so, try ee clean --all , then ee stack upgrade to ensure you have everything current and to restart the entire stack.

I hope this helps!


#6

So sad, I have my lastest EE installed and also run ee clean and upgrade. Nothing changes, till now :frowning:


#7

I’m facing the same problem… any update on this? Have tried with the nginx conf… no luck


#8

@Duy_Anh_Hoang

I’m running an ecommerce site powered by wordpress and woocommerce on a linode vps, however, there is something pretty strange. I turned off all of my cache plugins (W3 total and Wordfence) but my shopping cart page and check out page still got cached and show previous session instead of current session. I also created a file named “woo-nginx.conf” just like the tutorial here: Woocommerce and redis cache method but still no use. Would u guys plz help me to figure it out. Thanks in advance.

I think you should go through this tutorial https://www.cloudways.com/blog/varnish-enabled-multisite-woocommerce-store/ about varnish cache for your WooCommerce store as it is the same to reduce the server load time.


#9