Home › Forums › WoodMart support forum › WP Rocket Cache with Cart Icon + JS Delay
WP Rocket Cache with Cart Icon + JS Delay
- This topic has 4 replies, 2 voices, and was last updated 8 months, 4 weeks ago by Luke Nielsen.
-
AuthorPosts
-
March 16, 2024 at 12:16 am #549492
adf_davidParticipantHi there!
I’ve tried googling this between WP Rocket and the theme but I’m struggling. What is the recommended way to prevent the cart icon from caching the cart contents on pages? Right now I have it to where if the user has the cookie “woocommerce_items_in_cart” to disable the cache so the cart icon is always zeroed out. The issue is once the user has an item in the cart all of the pages are no longer from the cache, slowing the site down on their end.
I personally like to use JS delay however the only problem I’m consistently running into is with the mobile menu. The menu doesn’t always load up when JS delay is active. I’ve tried to prevent those scripts from being delayed but it still happens. Everything else, even the full menu search bar, works with the JS delay.
Any help on this would be greatly appreciated.
March 17, 2024 at 5:25 pm #549757
adf_davidParticipantChecking back in on this. Looking to see what scripts need to be excluded for the mini cart icon and the mobile/side menu.
March 18, 2024 at 11:48 am #549853
Luke NielsenKeymasterHello,
The thing is that the Cart page should not be cached at all. Disable the cache for that page and recheck the issue with the icon.
Looking forward to hearing back from you!
Kind Regards
- This reply was modified 9 months ago by Luke Nielsen.
March 18, 2024 at 5:26 pm #550068
adf_davidParticipantI’ve very confused by this reply because I never made mention of caching the cart page. I’m referring to the cart icon with the count on it or subtotal. I’m trying to prevent that from being cached. How can I prevent the cart total and count on the MINI CART ICON IN THE HEADER from being cached?
I’m also looking to find out which script is for the mobile menu. I’d like to utilize the JS delay with WP rocket but the biggest issue I run into is with the mobile menu. When I try to open up the menu with the JS delay enabled the menu doesn’t work. The full screen search works always but the menu doesn’t 50-100% of the time. I need to the know the script that handles it so I can try to exclude it.
March 19, 2024 at 5:52 pm #550419
Luke NielsenKeymasterHello,
Sorry for the delay.
The thing is that the counter in the mini cart icon from the header should be updated through JS even if you use a cache, such functionality comes by default from WooCommerce, e.g. WooCommerce Storefront theme: https://prnt.sc/oAo5czucwNgY , so I suggest checking the issue on the default WooCommerce Storefront theme to determine if it’s a problem with our theme or not.
As for the menu item, is there any chance that you could give me access to the dashboard area so I can have a look at the settings on your website, please?
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register