Speed · high impact

WooCommerce cart fragments run on every page

WooCommerce makes an uncached AJAX request (get_refreshed_fragments) on every page to keep the mini-cart count up to date — even on pages that don't show a cart.

Why it matters

That request bypasses page caching and hits PHP and the database on every visit, slowing the page and loading your server.

How to fix it in WordPress

  1. Decide where you actually need a live cart count (usually only the header mini-cart).
  2. Disable cart fragments everywhere except cart/checkout/product pages, using your performance plugin or a plugin like 'Disable Cart Fragments'.
  3. Clear your page cache and test adding a product to the cart.

Plugin-specific steps

Already using one of these plugins? Follow the exact steps for your setup.

Perfmatters

  1. 1Go to Settings → Perfmatters → General → WooCommerce.
  2. 2Toggle on 'Disable Cart Fragmentation'.
  3. 3Save, clear cache, then add a product to the cart and confirm the cart page still updates.

How to verify the fix

  • Open DevTools → Network and reload the homepage. 'get_refreshed_fragments' should no longer appear.
  • Add a product to the cart and confirm the cart and checkout still work.

Be careful

  • If your header shows a live cart count, it may not update until the visitor reaches the cart page.

Find out which of these your site has.

Free scan with real Google data. Exact fixes for your plugins.