When using WPRocket, the mini cart widget is not correctly updating after adding a product to the cart. Stays at 0 when visiting other pages. Currently, we have added this to the WPRocket Advanced -> Never Cache cookies (woocommerce_items_in_cart), but we do not like this solution since all customers with items in their cart will not use a cached version of the site. This also includes bypassing the CDN for all files.
According to WP-Rocket it is a theme Ajax issue and they suggested contacting you to see if you have a solution. See their response below.
Adding that solution does not fix this issue as it is not the same as we have. We already tried that and WPRocket told us that would not work. Can you please respond to the actual issue we sent in our first message on the ticket?
Also, before modifying our site again, please ask first or let us know what we should do to test.
This issue is causing us server-related problems now.
It appears that my SQL server is getting overloaded with queries. The hourly stats for the last 3 hours show an average of 13 million queries per hour. Once a person has something in their cart the caches are bypassed based on the settings (needed to not cache pages after something is in the cart) for WPRocket and the fact that the Penci theme does not "AJAX-ify" the cart widget. The SQL requests will drop dramticaly if this issue is fixed as all pages would be cached.
Are you looking into this? I have not had any response in 5 days.
When using WPRocket, the mini cart widget is not correctly updating after adding a product to the cart. Stays at 0 when visiting other pages. Currently, we have added this to the WPRocket Advanced -> Never Cache cookies (woocommerce_items_in_cart), but we do not like this solution since all customers with items in their cart will not use a cached version of the site. This also includes bypassing the CDN for all files.
According to WP-Rocket it is a theme Ajax issue and they suggested contacting you to see if you have a solution. See their response below.
The only workaround for this would be to "AJAX-ify" your cart widget. Using AJAX for cart widgets is required in order for them to be compatible with our page caching -- you can't rely on PHP to update it, because WP Rocket eliminates all PHP/MySQL processes from a page and creates static HTML output instead (as do most other caching plugins). The specifics will vary depending on your theme, but the concept is described in these posts: https://developer.woo.com/2023/06/16/best-practices-for-the-use-of-the-cart-fragments-api/https://wp-rocket.me/blog/using-woocommerce-dynamic-cart-wp-rocket/ http://docs.woothemes.com/document/show-cart-contents-total/
These issues happen on all our sites using WooCommerce.
Hi,
For this case, please send me your WordPress admin account in a PRIVATE reply.
I'll log in and try to help you configure it.
Regards,
PenciDesign.
Hi,
I've config your site by following the document guide at this link: https://docs.wp-rocket.me/article/1436-mini-cart-cached-already-has-product-in-it
Please clear all the browser caches and check again.
Regards,
PenciDesign.
Hello,
Adding that solution does not fix this issue as it is not the same as we have. We already tried that and WPRocket told us that would not work. Can you please respond to the actual issue we sent in our first message on the ticket?
Also, before modifying our site again, please ask first or let us know what we should do to test.
Thanks
Hello,
Do you have any updates since my last post?
Hello,
This issue is causing us server-related problems now.
It appears that my SQL server is getting overloaded with queries. The hourly stats for the last 3 hours show an average of 13 million queries per hour. Once a person has something in their cart the caches are bypassed based on the settings (needed to not cache pages after something is in the cart) for WPRocket and the fact that the Penci theme does not "AJAX-ify" the cart widget. The SQL requests will drop dramticaly if this issue is fixed as all pages would be cached.
Are you looking into this? I have not had any response in 5 days.
Hi,
We need to run some tests on the testing site, so I'll update this ticket when everything is resolved.
Thank you for your information.
Regards,
PenciDesign.