WooCommerce CRO Technique
How to reduce WooCommerce wc-ajax=get_refreshed_fragments overhead
This technique reduces wasted wc-ajax=get_refreshed_fragments calls by stopping WooCommerce’s legacy cart-fragments refresh where a live mini-cart is not actually needed, or by replacing the legacy widget with the Block-based Mini-Cart that WooCommerce says does not use the cart-fragments API.
Summary
Bottom Line: wc-ajax=get_refreshed_fragments is WooCommerce’s legacy cart-refresh call for keeping the mini-cart in sync without a full page reload. On WooCommerce 7.8+ it should not run sitewide by default, so if it still fires on home, category or content pages, the usual cause is a legacy
- The best long-term fix is usually to replace the legacy Cart widget with the Mini-Cart block, because WooCommerce says the block has built-in performance measures and does not use the cart-fragments API.
- On WooCommerce 10.4, the Interactivity API Mini Cart became the default and WooCommerce describes it as using smaller JavaScript bundles, but extensions that customise Mini Cart behaviour should be retested against the new implementation.
- Perfmatters offers a quick no-code reduction by disabling fragments when the woocommerce_cart_hash cookie is absent, but that is a vendor implementation and must be regression-tested afterwards.
- Measure both performance and behaviour: lower TTFB and mobile INP on non-cart templates, while add_to_cart, header cart count, checkout completion, conversion rate, AOV and RPV stay intact.
How To Implement
Check version and current behaviour before changing anything
Go to WooCommerce > Status and note the WC Version, active theme, and any template overrides. WooCommerce says that from 7.8 onwards, cart fragments stopped being enqueued on all routes by default, so a current store that still fires
get_refreshed_fragmentson non-cart pages is usually opting back in through theme or plugin behaviour.Confirm where the request fires and what triggers it
Open the homepage, a category page, a product page, and one non-shop content template. In Chrome DevTools > Network, filter for
get_refreshed_fragments, then inspect the Initiator column or the request’s Initiator tab. Chrome documents that this shows what caused the request; WooCommerce says the common post-7.8 causes are a rendered Cart widget, a third-party script registeringcart-fragmentsas a dependency, or code that explicitly enqueues the script.If the store uses a block theme or Site Editor header, move to the Mini-Cart block
In block-theme setups, edit the header in Appearance > Editor and use the Mini-Cart block/template part rather than a legacy widget-based cart. WooCommerce’s Mini-Cart docs show the template part under Appearance > Editor > Patterns > Template Parts > Mini-Cart. WooCommerce also says the Mini-Cart block does not use the cart-fragments API; from 10.4, the Interactivity API Mini Cart is the default implementation and WooCommerce says it ships smaller JavaScript bundles.
Handle classic themes differently
If the Cart widget lives in a widget area, replace that widget with the Mini-Cart block in the same header/sidebar area where the theme allows it. If the theme hard-codes the mini-cart widget in a PHP template, this is a theme/template job: WooCommerce explicitly warns that some classic themes do this, including Storefront-era patterns, so removing a widget in WP Admin alone may not stop the request.
Use the quickest no-code reduction if you need a safe first step
In Perfmatters > General > WooCommerce, enable Disable Cart Fragmentation. Perfmatters says this checks for the
woocommerce_cart_hashcookie and disables fragments when no cart is present. Measurement note: capture a before/after waterfall and run a live add-to-cart test immediately after saving, because a plugin toggle can reduce load while still breaking a theme’s expected cart behaviour.If you must keep the legacy widget for now, scope the script to cart-relevant pages only
WooCommerce documents the following
woocommerce_get_script_datafilter sowc-cart-fragmentsstill loads but does not execute outside Woo/cart/checkout routes:“
php add_filter( 'woocommerce_get_script_data', function( $script_data, $handle ) { if ( 'wc-cart-fragments' === $handle ) { if ( is_woocommerce() || is_cart() || is_checkout() ) { return $script_data; } return null; } return $script_data; }, 10, 2 );“Use this via a child theme or a snippets plugin, not by editing core files. WooCommerce’s own caveats matter here: custom pages that behave like shop/cart pages but do not meet those conditional checks may stop updating correctly, and cached pages that still expose a mini-cart can show stale cart state.
Validate on a real mobile device before sign-off
Chrome’s docs state that remote debugging real devices gives the best feel for performance and touch, so do the final check on a real Android handset using Chrome remote debugging rather than desktop emulation alone. Test home/category/product pages, add an item, confirm the header cart count or drawer updates, then open cart and checkout. If you are on WooCommerce 10.4+, also test any extension that customises Mini Cart behaviour because WooCommerce flags that as a compatibility check for the new Interactivity API default.
How To Measure
The primary technical KPI is TTFB on non-cart templates and mobile INP on the same templates; the commercial KPI is conversion rate and RPV for sessions landing on those templates. Chrome describes TTFB as foundational because it precedes later paint metrics, and Google’s Core Web Vitals guidance treats INP ≤200 ms, LCP ≤2.5s and CLS ≤0.1 at the 75th percentile as the target for a good experience.
In GA4, use the Landing page report for affected landing pages and, when you need more control, an Exploration filtered to the affected page paths or template group. Watch the ecommerce events and outcomes that matter here: add_to_cart, view_cart, begin_checkout and purchase, plus Sessions and Total revenue for those landers. GA4’s Landing page report is session-scoped, which makes it suitable for comparing landing-page cohorts before and after the change.
Read the result in two slices. First, check PageSpeed Insights and Search Console Core Web Vitals for the affected URL group, because PSI combines lab guidance with field context and Search Console reports real-world Core Web Vitals grouped by URL patterns. Second, compare mobile-only sessions versus desktop in GA4 using comparisons or separate explorations, because cart-fragment pain is often most visible on slower mobile hardware.
Success looks like this: the get_refreshed_fragments request no longer appears on pages where it is not needed, or it becomes materially less expensive; non-cart TTFB drops; mobile INP improves or holds in the good range; and the header cart still updates correctly after add-to-cart. Guardrails are conversion rate, RPV, AOV, checkout completion, add_to_cart volume, and CLS. If the request disappears but the header cart count, mini-cart drawer or cart hand-off breaks, that is not a win.
Pitfalls
- Mistake: disabling fragments globally when a live header cart is still central to the UX. WooCommerce’s own caveats say non-standard cart-like pages can stop updating correctly, and cached pages that expose a mini-cart may not refresh to the shopper’s session if you scope execution too aggressively.
- Mistake: solving the symptom, not the cause. Delaying or disabling the script can reduce the waterfall cost, but WooCommerce’s preferred structural fix is to replace the legacy Cart widget with the Mini-Cart block, especially if the theme or plugin stack is still depending on the old widget.
- Mistake: trusting desktop simulation as the final word. Google distinguishes lab data from field data, and Chrome notes that real-device remote debugging gives the best feel for performance and touch; for this technique, sign-off should happen on a physical handset.
- Edge case: assuming 10.4’s new Mini Cart is always drop-in safe. WooCommerce says the Interactivity API Mini Cart is now the default, but extensions that customise Mini Cart behaviour should be tested against it.
Examples
FAQs
Yes — but only if the request is still appearing where it should not. WooCommerce 7.8 reduced default sitewide enqueueing, so continued non-cart requests usually point to a legacy widget, a hard-coded theme implementation, a dependency registered by another script, or explicit enqueue code.
No — not safely on stores that rely on a live header mini-cart, count, or custom cart-like pages. WooCommerce’s own documented caveats are that custom pages outside standard conditionals may stop updating and cached pages with a mini-cart may show stale session state.
Usually, yes, if the legacy Cart widget is what is triggering the request. WooCommerce says the Mini-Cart block does not use the cart-fragments API, and from 10.4 the Interactivity API-based Mini Cart is the default implementation.
No — not by itself. Google explains that lab and field data measure different things, and WP Rocket notes that many speed-test tools call get_refreshed_fragments like a fresh visitor on every run, so you should pair waterfall checks with field data and real-device testing before judging impact.
Sources & Further Reading
- WooCommerce 10.4: The Interactivity API Mini Cart Goes Live – Official release note confirming that the Interactivity API Mini Cart became the default in 10.4, with smaller JS bundles and extension-testing caveats. Published 10 December 2025.
- Understanding the Interactivity API-driven future for WooCommerce Blocks – Useful context on how WooCommerce is moving interactive blocks, including MiniCart, towards the Interactivity API. Published 30 October 2025.
- Mini-Cart block Documentation – Official user documentation for where the Mini-Cart lives in headers and how to access/edit the Mini-Cart template part in the Site Editor. Date not stated on page; accessed 18 June 2026.
- Understanding the WooCommerce System Status Report – Official reference for checking WooCommerce version, theme, blocks package and template overrides before diagnosing the issue. Date not stated on page; accessed 18 June 2026.
- Disable WooCommerce cart fragments AJAX – Vendor documentation for the Perfmatters toggle, including its woocommerce_cart_hash cookie logic and admin path. Treat performance claims as vendor-directional. Date not stated on page; accessed 18 June 2026.
- Optimize WooCommerce get refreshed fragments – Vendor note explaining why synthetic tests often show the request on each run and how cached empty-cart responses are handled. Last updated 9 November 2023.
- Inspect network activity – Official Chrome DevTools doc confirming that the Initiator field shows what caused a resource request, which is useful when tracing get_refreshed_fragments. Published around late 2024 in search metadata; exact on-page publish date not surfaced in retrieved excerpt.
- Remote debug Android devices – Official method for testing the change on a real Android device. Published 13 April 2015.
- Document request latency – Official Chrome guidance linking TTFB to document latency and citing the commonly used 800 ms TTFB benchmark. Published 27 March 2025.
- Web Vitals – Google guidance for the Core Web Vitals thresholds used here: LCP ≤2.5s, INP ≤200 ms, CLS ≤0.1 at the 75th percentile. Date not surfaced in retrieved excerpt; accessed 18 June 2026.
- Why lab and field data can be different – Google explanation of why lab waterfalls and real-user data can disagree, and why field data should guide prioritisation. Last updated 18 July 2022.
- Measure ecommerce – Official GA4 ecommerce event reference for add_to_cart, view_cart, begin_checkout, purchase and related measurement. Updated 4 May 2026.
Want us to implement this for you?
We run measured CRO consultancy for WooCommerce. If you want help prioritising, testing & implementing these improvements, tell us about your store.
Book PilotAbout This Page
- Written By: Eliot Webb – Founder & WooCommerce CRO Consultant
- Last Reviewed: 18 Jun 2026
- Last Updated: