Cart quantity icon cache problem with wp-rocket
January 5, 2022 at 2:11 pm #343599
Hi, we are dealing with the follow problem.
We are using wprocket for caching our site. Everything works great except that the quantity icon shows cached values.
For example if you visit homepage and then a product page and you add a product in the cart. In that product page that you add the product, the quantity will be become “1”.
But when you go back to the homepage that is already been cached from previous visit, the quantity will be “0”.
So, we need not to caching the quantity on the cart icon.
We use the follow suggestions from wp-rocket:
This plugin didn’t help – The problem remained
We exclude from WP Rocket → Advanced Rules and enter the following value in the Never Cache Cookies field: woocommerce_items_in_cart
With that field saved on the wprocket, the icon fixed but it fixed because the cache page stopped. With that settings every time you visit a page, the page loads from the start so we don’t have caching in our site.
After explain those to wp-rocket support they answered the follow:
“If this plugin – WP Rocket | Deactivate WooCommerce Refresh Cart Fragments Cache – doesn’t help, and if the only way to make it work is to prevent caching, then it means that your cart icon has not been coded in a way that is compatible with caching. So we won’t be able to fix this on our end.
Please see the “Cart Widgets” section here:
Instead they need to fetch and display the quantity using an AJAX request. This will always be accurate even with caching”
So, please we need your help.
Thank you on advance
January 6, 2022 at 1:18 am #343701
- This topic was modified 1 year ago by firstname.lastname@example.org.
I have checked the documentation provided by WP Rocket, I see the recommendation on the advanced rules.
Please check this article and make sure you have excluded all the recommended files: https://space.xtemos.com/wordpress-performance-optimization-the-ultimate-guide-in-2021#Step_4
If you have already excluded the list of the files and the problem persists, please let us know.
Best RegardsJanuary 6, 2022 at 8:24 am #343743
I have the checked the documentation and me.
I gave you private details to login to check by yourself and to see why is not working.
So, i have exclude all about the documentation, so PLEASE login to the site and see by yourself that everything is setuped correctly and after that check why is not working.
Thank you in advance.January 6, 2022 at 1:59 pm #343840
Please add this line into the functions.php of the child theme:
add_filter( 'woodmart_update_fragments_fix', '__return_false' );
January 13, 2022 at 7:45 am #345046
- This reply was modified 1 year ago by Elise Noromit.
Thanks for your reply. worked fine but we have the same problem with the wishlist quantity icon
can you send us a filter to exclude this too?January 14, 2022 at 3:08 pm #345432
Please describe step by step how we can reproduce the problem.
Best RegardsJanuary 15, 2022 at 9:23 am #345564
We have active wp rocket and perfectly working.
One problem of the wprocket is that preload works only for not logged in users. If a user logged in stops seeing cached pages.
For this problem there is a solution based on this article
So, what we do is that activated the plugin
WP Rocket | Common Cache For Logged-in Users
This plugin solves this problem but created the following problem
It is caching the quantity icon of the wishlist, so all the logged in users sees the same quantity on the icon!
For example if one logged in user adds 4 products in the wishlist and this page cached at this moment, every logged in user will see the quantity wishlist icon to appear 4 products in their wishlist, even if they don’t have nothing in their wishlist.
The problem is not when the user visit on the wishlist page because we have exclude that page from caching.
The problem is only in the quantity wishlist icon.
As wp-rocket said you are the only, that you can help because we need a filter fuction to exclude it based on the theme.January 17, 2022 at 10:39 am #345853
Our developers are working on this issue and this would be fixed in the nearest update.
If you have any questions please feel free to contact us.
- You must be logged in to create new topics. Login / Register