Home / Forums / WoodMart support forum / Header Cart Count Shows Incorrect Value on Cached Pages
Home › Forums › WoodMart support forum › Header Cart Count Shows Incorrect Value on Cached Pages
Header Cart Count Shows Incorrect Value on Cached Pages
- This topic has 11 replies, 2 voices, and was last updated 3 months, 3 weeks ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
March 6, 2026 at 1:13 am #711168
x7corpParticipantHi,
We’re experiencing an issue with the header cart count when page caching is enabled.
Behaviour:
• Add an item to the cart
• Navigate to another (cached) page
• The header cart number reverts to the cached value instead of showing the actual cart quantityImportant notes:
• The issue disappears immediately if WP Rocket page caching is disabled.
• Other cache layers (Cloudflare and server cache) have been ruled out via staging tests.
• I also tested WP Rocket’s WooCommerce fragment compatibility plugin (Deactivate WooCommerce Refresh Cart Fragments Cache), but the behaviour remained unchanged.WP Rocket support reviewed the setup and confirmed the same behaviour when page caching is active.
Could you please advise how the Header Builder cart element is intended to function when page caching is enabled, and whether there is a recommended configuration to ensure the cart count updates correctly on cached pages?
Thanks in advance.
Attachments:
You must be logged in to view attached files.March 6, 2026 at 2:35 pm #711262Hello,
In general, Wishlist, Cart and Compare pages should not be cached at all, so I suggest you exclude those pages from the cache and recheck the issue.
Please refer to the topic for more details https://docs.wp-rocket.me/article/54-exclude-pages-from-the-cache
Best Regards
March 6, 2026 at 5:42 pm #711354
x7corpParticipantHi,
You have misunderstood what I have said. I am taking about the Cart Counter icon at the top right hand corner of every page? please see screen shot.
Attachments:
You must be logged in to view attached files.March 7, 2026 at 8:31 am #711406Hello,
Actually, it has a fragment refresh functionality, so it should always display the number of items of the current user even with cache.
Try to exclude the following script “wc-cart-fragments and Clear” all caches after applying the changes.
Best Regards,
March 7, 2026 at 1:43 pm #711445
x7corpParticipantHi,
Thank you for the suggestion.
I had already previously tested with all WP Rocket JavaScript optimisations disabled, and the issue still remained, which is why WP Rocket support narrowed this down to page caching itself rather than file optimisation.
For completeness, I also excluded
wc-cart-fragmentsfrom Minify JS, Load JS Deferred, and Delay JavaScript Execution, then cleared all caches, but the behaviour is unchanged.Current findings:
• The issue only occurs when WP Rocket page caching is active
• The issue disappears immediately when WP Rocket page caching is disabled
• Cloudflare and server-side caching were ruled out on staging
• Disabling JS optimisation does not resolve it
• WP Rocket’s WooCommerce fragment compatibility plugin also did not resolve itBased on this, the issue appears to be specifically related to how the Header Builder cart element behaves when served from cached pages.
Could you please advise whether there is any known issue, setting, or recommended fix for ensuring the header cart count updates correctly with page caching enabled?
March 9, 2026 at 11:10 am #711601Hello,
Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.
Best Regards
March 9, 2026 at 11:24 pm #711790
x7corpParticipantPlease see Private Content field
March 10, 2026 at 2:39 pm #711899Hello,
Your issue has been solved. Please go to Settings >> WP Rocket >> File Optimization >> JS Files >> Delay Javascript execution >> Exclude the Woodmart cart fragement and now the mini cart count is working fine: https://ibb.co/2G0Vj26
Best Regards.
March 10, 2026 at 3:37 pm #711916
x7corpParticipantHi,
I have just checked, and the issue is still present on the staging site after you turn on this setting. It has not been solved.
Please note that:
1. Caching is not active when logged in, so you must use incognito, etc
2. After changing settings on WP Rocket the cache resets, so you must first load the page to create cache, then add to cart and then visit the same page you just cached.
March 11, 2026 at 10:24 am #712031Hello,
I have found that you are using the older version of Woocommerce plugin on the site. I have updated the plugin now your site is down. Can you please check and update all the plugins and WP version to the latest versions then check back the issue.
Best Regards.
March 11, 2026 at 2:12 pm #712083
x7corpParticipantHi,
I have recreated the staging site again, and have updated all plugins except 1 which has custom modifications but is not related to this issue. WooCommerce & WP updates came overnight.
Any changes you made to the Staging site is lost.
The issue still exists. I have provided a new Staging login in hidden section.
March 12, 2026 at 3:24 pm #712299Hello,
We have disabled third-party plugins on your staging site, except for WP Rocket, and this issue does not occur. You can verify this yourself.
Best Regards.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register