HomeMethod

Knowledge

Web VitalsTechniquesSnippetsAnswersImpactsBottlenecks

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

  1. Network tab: Search for wc-ajax=get_refreshed_fragments
  2. Script list: Check whether wc-cart-fragments loads globally
  3. 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.

Support our family now