WooCommerce cart fragments on all pages
- Rendering
Problem Summary
WooCommerce cart fragments on all pages load cart-refresh JavaScript even when the visitor is not shopping or the page has no cart UI.
Performance Impact
- Extra AJAX requests: Cart fragments call the server after page load
- Worse TTFB pressure: Dynamic cart endpoints bypass normal page cache
- Unneeded JavaScript: Non-shop pages pay ecommerce overhead
- Lower cache efficiency: Cart personalization can complicate caching
How to Detect
- Network tab: Search for
wc-ajax=get_refreshed_fragments - Script list: Check whether
wc-cart-fragmentsloads globally - Page comparison: Test homepage, blog, product, cart, and checkout pages
Solutions
1. Disable Fragments Where Unused
Dequeuing cart fragments on non-commerce pages often removes the extra request.
2. Keep Cart Pages Dynamic
Do not break mini-cart, cart, checkout, or account behavior.
3. Use Block-Based Cart Features Carefully
Modern WooCommerce cart features may load different assets, so test the actual setup.
4. Measure After Changes
Confirm cart count, add-to-cart, and checkout behavior still work.