{"id":637,"date":"2025-09-16T23:30:41","date_gmt":"2025-09-16T23:30:41","guid":{"rendered":"https:\/\/www.pofii.com\/blog\/?p=637"},"modified":"2025-09-16T23:30:42","modified_gmt":"2025-09-16T23:30:42","slug":"woocommerce-cart-fragments-stop-the-ajax-drag","status":"publish","type":"post","link":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/","title":{"rendered":"WooCommerce Cart Fragments: Stop the AJAX Drag"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Works great on any host. On Pofii\u2019s <strong>Pofii-Tuned LiteSpeed<\/strong>, pair this with LSCache ESI for a fast, safe setup.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#What_cart_fragments_are_and_why_they_slow_things\" >What cart fragments are (and why they slow things)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#How_to_see_it\" >How to see it<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Why_its_a_problem\" >Why it\u2019s a problem<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Decide_your_strategy_pick_one\" >Decide your strategy (pick one)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Fix_1_%E2%80%94_Disable_fragments_sitewide_keep_them_on_CartCheckout\" >Fix #1 \u2014 Disable fragments sitewide (keep them on Cart\/Checkout)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#When_to_use_this\" >When to use this<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Fix_2_%E2%80%94_Delay_fragments_until_user_interacts\" >Fix #2 \u2014 Delay fragments until user interacts<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#When_to_use_this-2\" >When to use this<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Fix_3_%E2%80%94_Lightweight_counter_no_full_fragments\" >Fix #3 \u2014 Lightweight counter (no full fragments)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Theme_cache_and_CDN_checks\" >Theme, cache, and CDN checks<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#LiteSpeed_Cache_LSCache\" >LiteSpeed Cache (LSCache)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Cloudflare_CDN\" >Cloudflare \/ CDN<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Object_cache_Redis\" >Object cache (Redis)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Images_LCP\" >Images &amp; LCP<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Test_plan_5_minutes\" >Test plan (5 minutes)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Minimal_checklist\" >Minimal checklist<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Will_disabling_fragments_break_checkout\" >Will disabling fragments break checkout?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#My_theme_has_a_fancy_mini-cart_What_should_I_do\" >My theme has a fancy mini-cart. What should I do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Do_I_need_a_plugin_for_this\" >Do I need a plugin for this?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#Why_is_TTFB_still_high_after_changes\" >Why is TTFB still high after changes?<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-what-cart-fragments-are-and-why-they-slow-things\"><span class=\"ez-toc-section\" id=\"What_cart_fragments_are_and_why_they_slow_things\"><\/span>What cart fragments are (and why they slow things)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Cart fragments are a WooCommerce script (<code>wc-cart-fragments<\/code>) that refreshes mini-cart HTML via <code>wc-ajax=get_refreshed_fragments<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-see-it\"><span class=\"ez-toc-section\" id=\"How_to_see_it\"><\/span>How to see it<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open <strong>DevTools \u2192 Network<\/strong>.<\/li>\n\n\n\n<li>Load any page.<\/li>\n\n\n\n<li>You\u2019ll see <code>?wc-ajax=get_refreshed_fragments<\/code> soon after the first paint.<\/li>\n\n\n\n<li>That request runs on <strong>every page view<\/strong> by default.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-why-it-s-a-problem\"><span class=\"ez-toc-section\" id=\"Why_its_a_problem\"><\/span>Why it\u2019s a problem<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Extra requests increase <strong>TTFB<\/strong> and <strong>JS main-thread<\/strong> work.<\/li>\n\n\n\n<li>On mobile and slower connections, it\u2019s noticeable.<\/li>\n\n\n\n<li>Many themes don\u2019t even show a dynamic mini-cart. You pay the cost anyway.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-decide-your-strategy-pick-one\"><span class=\"ez-toc-section\" id=\"Decide_your_strategy_pick_one\"><\/span>Decide your strategy (pick one)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Disable fragments<\/strong> everywhere except <strong>Cart\/Checkout<\/strong>.<\/li>\n\n\n\n<li><strong>Delay fragments<\/strong> until the visitor shows intent (scroll, hover, click).<\/li>\n\n\n\n<li><strong>Replace fragments<\/strong> with a <strong>lightweight counter<\/strong> updated on add-to-cart.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Start with <strong>disable except Cart\/Checkout<\/strong>. It\u2019s the safest and fastest win.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-fix-1-disable-fragments-sitewide-keep-them-on-cart-checkout\"><span class=\"ez-toc-section\" id=\"Fix_1_%E2%80%94_Disable_fragments_sitewide_keep_them_on_CartCheckout\"><\/span>Fix #1 \u2014 Disable fragments sitewide (keep them on Cart\/Checkout)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Place this in your theme\u2019s <code>functions.php<\/code> or a small mu-plugin:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Disable WooCommerce cart fragments everywhere except cart\/checkout\nadd_action('wp_enqueue_scripts', function () {\n  if (is_admin()) return;\n  if (!is_cart() &amp;&amp; !is_checkout()) {\n    wp_dequeue_script('wc-cart-fragments');\n    wp_deregister_script('wc-cart-fragments');\n    \/\/ Optional: tidy up fragment storage to avoid stale noise\n    wp_add_inline_script('jquery', \"try{sessionStorage.removeItem('wc_fragments');localStorage.removeItem('wc_cart_hash');}catch(e){}\");\n  }\n}, 100);\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-when-to-use-this\"><span class=\"ez-toc-section\" id=\"When_to_use_this\"><\/span>When to use this<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your header shows a cart <strong>icon<\/strong> or static <strong>link<\/strong>.<\/li>\n\n\n\n<li>You don\u2019t need real-time mini-cart content on every page.<\/li>\n\n\n\n<li>You do need 100% reliable <strong>Cart<\/strong> and <strong>Checkout<\/strong> pages.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-fix-2-delay-fragments-until-user-interacts\"><span class=\"ez-toc-section\" id=\"Fix_2_%E2%80%94_Delay_fragments_until_user_interacts\"><\/span>Fix #2 \u2014 Delay fragments until user interacts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your theme needs the mini-cart, load fragments <strong>after<\/strong> a small signal\u2014like the first scroll or hover. Keep the default script, but stop it from firing instantly by removing it and loading it on demand.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Delay loading of wc-cart-fragments until user interacts\nadd_action('wp_enqueue_scripts', function () {\n  if (is_admin() || is_cart() || is_checkout()) return;\n\n  \/\/ Don't load the default script now\n  wp_dequeue_script('wc-cart-fragments');\n  wp_deregister_script('wc-cart-fragments');\n\n  \/\/ Load it after first interaction\n  $script = &lt;&lt;&lt;JS\n  (function(){\n    var loaded=false;\n    function loadWCCF(){\n      if(loaded) return; loaded=true;\n      var s=document.createElement('script');\n      \/\/ WordPress will print the real URL for us via localized param if present; fallback is common handle path\n      s.src = (window.wc_cart_fragments_params &amp;&amp; window.wc_cart_fragments_params.wc_ajax_url)\n              ? window.wc_cart_fragments_params.wc_ajax_url.replace('wc-ajax=%%endpoint%%','') + 'wp-content\/plugins\/woocommerce\/assets\/js\/frontend\/cart-fragments.min.js'\n              : '\/wp-content\/plugins\/woocommerce\/assets\/js\/frontend\/cart-fragments.min.js';\n      document.head.appendChild(s);\n    }\n    &#91;'mousemove','touchstart','scroll','keydown'].forEach(function(evt){\n      window.addEventListener(evt, loadWCCF, {passive:true, once:true});\n    });\n  })();\n  JS;\n  wp_add_inline_script('jquery', $script);\n}, 100);\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-when-to-use-this-0\"><span class=\"ez-toc-section\" id=\"When_to_use_this-2\"><\/span>When to use this<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You want a <strong>live mini-cart<\/strong>.<\/li>\n\n\n\n<li>You still want a <strong>fast first paint<\/strong>.<\/li>\n\n\n\n<li>You\u2019re okay with loading the mini-cart <strong>on demand<\/strong>.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-fix-3-lightweight-counter-no-full-fragments\"><span class=\"ez-toc-section\" id=\"Fix_3_%E2%80%94_Lightweight_counter_no_full_fragments\"><\/span>Fix #3 \u2014 Lightweight counter (no full fragments)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your header only needs a <strong>count<\/strong>, update it on the <code>added_to_cart<\/code> event. No fragment refresh needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>HTML (in your header):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"\/cart\" class=\"mini-cart-link\"&gt;\n  Cart &lt;span class=\"mini-cart-count\"&gt;0&lt;\/span&gt;\n&lt;\/a&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>JS (enqueue a tiny script):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(function($){\n  $(document.body).on('added_to_cart', function(e, fragments, cart_hash){\n    \/\/ If fragments are available, try to read a count; else fall back to +1\n    var $count = $('.mini-cart-count');\n    var current = parseInt($count.text(), 10) || 0;\n    $count.text(current + 1);\n  });\n})(jQuery);\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">This does <strong>not<\/strong> show line items. It keeps the UI snappy and accurate enough for most stores.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-theme-cache-and-cdn-checks\"><span class=\"ez-toc-section\" id=\"Theme_cache_and_CDN_checks\"><\/span>Theme, cache, and CDN checks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-litespeed-cache-lscache\"><span class=\"ez-toc-section\" id=\"LiteSpeed_Cache_LSCache\"><\/span>LiteSpeed Cache (LSCache)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep <strong>page cache<\/strong> for anonymous users.<\/li>\n\n\n\n<li>Exclude <code>\/cart\/<\/code>, <code>\/checkout\/<\/code>, <code>\/my-account\/<\/code> from cache.<\/li>\n\n\n\n<li>Use <strong>ESI<\/strong> for the mini-cart widget if you must show dynamic content in a cached page. See our guide: <strong><a href=\"https:\/\/www.pofii.com\/blog\/litespeed-cache-for-wordpress-safe-defaults-for-speed-woo-included\/\">LiteSpeed Cache safe defaults<\/a><\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cloudflare-cdn\"><span class=\"ez-toc-section\" id=\"Cloudflare_CDN\"><\/span>Cloudflare \/ CDN<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Bypass<\/strong> HTML cache for logged-in users and checkout paths.<\/li>\n\n\n\n<li>Don\u2019t force \u201cCache Everything\u201d on pages with cart state.<\/li>\n\n\n\n<li>Keep <strong>Full (strict)<\/strong> SSL to avoid redirect loops.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-object-cache-redis\"><span class=\"ez-toc-section\" id=\"Object_cache_Redis\"><\/span>Object cache (Redis)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It helps database work, but it <strong>won\u2019t fix fragments<\/strong>. Use it alongside the fixes above. See: <strong><a href=\"https:\/\/www.pofii.com\/blog\/wordpress-object-cache-redis-vs-memcached-setup-guide\/\">WordPress Object Cache (Redis)<\/a><\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-images-amp-lcp\"><span class=\"ez-toc-section\" id=\"Images_LCP\"><\/span>Images &amp; LCP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A noisy fragments call often delays your <strong>hero image<\/strong>. Make sure the product hero is <strong>eager<\/strong> with <code>fetchpriority=\"high\"<\/code>. See: <a href=\"https:\/\/www.pofii.com\/blog\/woocommerce-image-speed-webp-avif-correct-sizes-lazy-load\/\"><strong>WooCommerce Image Speed<\/strong>.<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-test-plan-5-minutes\"><span class=\"ez-toc-section\" id=\"Test_plan_5_minutes\"><\/span>Test plan (5 minutes)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Network tab:<\/strong> load home\/category\/product; confirm no early <code>wc-ajax=get_refreshed_fragments<\/code> (except Cart\/Checkout).<\/li>\n\n\n\n<li><strong>Add to cart (AJAX):<\/strong> ensure header count or mini-cart updates based on your chosen fix.<\/li>\n\n\n\n<li><strong>Cart and Checkout:<\/strong> must work perfectly.<\/li>\n\n\n\n<li><strong>Repeat view:<\/strong> confirm faster first paint and lower request count.<\/li>\n\n\n\n<li><strong>Mobile:<\/strong> test on 4G\/slow-3G throttling.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-minimal-checklist\"><span class=\"ez-toc-section\" id=\"Minimal_checklist\"><\/span>Minimal checklist<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Choose a strategy: <strong>disable<\/strong>, <strong>delay<\/strong>, or <strong>counter only<\/strong><\/li>\n\n\n\n<li>Keep fragments active on <strong>Cart\/Checkout<\/strong><\/li>\n\n\n\n<li>Exclude Cart\/Checkout from <strong>page cache<\/strong><\/li>\n\n\n\n<li>If needed, use <strong>ESI<\/strong> for mini-cart widget<\/li>\n\n\n\n<li>Validate with DevTools (no early <code>wc-ajax<\/code> calls)<\/li>\n\n\n\n<li>QA add-to-cart, login, and checkout on mobile\/desktop<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-faq\"><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-will-disabling-fragments-break-checkout\"><span class=\"ez-toc-section\" id=\"Will_disabling_fragments_break_checkout\"><\/span>Will disabling fragments break checkout?<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">No. Cart and checkout <strong>do not<\/strong> rely on fragments. Keep fragments enabled <strong>only<\/strong> on those pages, and they work as expected.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-my-theme-has-a-fancy-mini-cart-what-should-i-do\"><span class=\"ez-toc-section\" id=\"My_theme_has_a_fancy_mini-cart_What_should_I_do\"><\/span>My theme has a fancy mini-cart. What should I do?<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Use <strong>Fix #2<\/strong> (delay) or <strong>ESI<\/strong> for that widget. Test on mobile. If it still hurts LCP, consider the <strong>counter-only<\/strong> approach.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-do-i-need-a-plugin-for-this\"><span class=\"ez-toc-section\" id=\"Do_I_need_a_plugin_for_this\"><\/span>Do I need a plugin for this?<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Not necessarily. The snippets above cover most cases. A lightweight plugin is fine if you prefer toggles.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-why-is-ttfb-still-high-after-changes\"><span class=\"ez-toc-section\" id=\"Why_is_TTFB_still_high_after_changes\"><\/span>Why is TTFB still high after changes?<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Fragments are one cause. Also check <strong>server time<\/strong>, <strong>database queries<\/strong>, and <strong>image priority<\/strong>. Pair this guide with LSCache and Redis for full speed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cart fragments can slow your store. They fire an AJAX request on every page to update the mini-cart. That extra call hurts TTFB and blocks render work. The fix is simple: limit fragments to where you need them, or delay them until the user interacts\u2014without breaking checkout.<\/p>\n","protected":false},"author":5,"featured_media":639,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,3],"tags":[240,242,218],"class_list":["post-637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ecommerce","category-hosting","tag-ajax","tag-ecommerce","tag-woocommerce"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WooCommerce Cart Fragments: Stop the AJAX Drag - Pofii Insights<\/title>\n<meta name=\"description\" content=\"Speed up WooCommerce by taming cart fragments. Disable or delay the AJAX mini-cart, reduce TTFB, and keep checkout working with safe fixes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WooCommerce Cart Fragments: Stop the AJAX Drag\" \/>\n<meta property=\"og:description\" content=\"Speed up WooCommerce by taming cart fragments. Disable or delay the AJAX mini-cart, reduce TTFB, and keep checkout working with safe fixes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/\" \/>\n<meta property=\"og:site_name\" content=\"Pofii Insights\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PofiiCOM\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-16T23:30:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-16T23:30:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"John Cavil\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@PofiiGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@PofiiGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Cavil\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/\"},\"author\":{\"name\":\"John Cavil\",\"@id\":\"https:\/\/www.pofii.com\/blog\/#\/schema\/person\/82dd56bd4b7d1ae512907145b3a68873\"},\"headline\":\"WooCommerce Cart Fragments: Stop the AJAX Drag\",\"datePublished\":\"2025-09-16T23:30:41+00:00\",\"dateModified\":\"2025-09-16T23:30:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/\"},\"wordCount\":641,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png\",\"keywords\":[\"AJAX\",\"eCommerce\",\"WooCommerce\"],\"articleSection\":[\"eCommerce\",\"Hosting Tips &amp; Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/\",\"url\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/\",\"name\":\"WooCommerce Cart Fragments: Stop the AJAX Drag - Pofii Insights\",\"isPartOf\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png\",\"datePublished\":\"2025-09-16T23:30:41+00:00\",\"dateModified\":\"2025-09-16T23:30:42+00:00\",\"description\":\"Speed up WooCommerce by taming cart fragments. Disable or delay the AJAX mini-cart, reduce TTFB, and keep checkout working with safe fixes.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage\",\"url\":\"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png\",\"contentUrl\":\"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png\",\"width\":1280,\"height\":720,\"caption\":\"stop ajax drag\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/nl.pofii.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WooCommerce Cart Fragments: Stop the AJAX Drag\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pofii.com\/blog\/#website\",\"url\":\"https:\/\/www.pofii.com\/blog\/\",\"name\":\"Pofii\",\"description\":\"Success Simplified.\",\"publisher\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pofii.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pofii.com\/blog\/#organization\",\"name\":\"Pofii\",\"url\":\"https:\/\/www.pofii.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pofii.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2024\/12\/cropped-cropped-pofiiinsights-2.png\",\"contentUrl\":\"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2024\/12\/cropped-cropped-pofiiinsights-2.png\",\"width\":2079,\"height\":221,\"caption\":\"Pofii\"},\"image\":{\"@id\":\"https:\/\/www.pofii.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/PofiiCOM\",\"https:\/\/x.com\/PofiiGlobal\",\"https:\/\/www.instagram.com\/PofiiGlobal\",\"https:\/\/www.linkedin.com\/company\/Pofii\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pofii.com\/blog\/#\/schema\/person\/82dd56bd4b7d1ae512907145b3a68873\",\"name\":\"John Cavil\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pofii.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.pofii.com\/brand\/logo-icon-circle-friendly.png\",\"contentUrl\":\"https:\/\/www.pofii.com\/brand\/logo-icon-circle-friendly.png\",\"caption\":\"John Cavil\"},\"description\":\"WordPress Expert, Head of technical support at Pofii Ltd.\",\"sameAs\":[\"https:\/\/www.pofii.com\/blog\/author\/JohnC\"],\"url\":\"https:\/\/www.pofii.com\/blog\/author\/johnc\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"WooCommerce Cart Fragments: Stop the AJAX Drag - Pofii Insights","description":"Speed up WooCommerce by taming cart fragments. Disable or delay the AJAX mini-cart, reduce TTFB, and keep checkout working with safe fixes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/","og_locale":"en_US","og_type":"article","og_title":"WooCommerce Cart Fragments: Stop the AJAX Drag","og_description":"Speed up WooCommerce by taming cart fragments. Disable or delay the AJAX mini-cart, reduce TTFB, and keep checkout working with safe fixes.","og_url":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/","og_site_name":"Pofii Insights","article_publisher":"https:\/\/www.facebook.com\/PofiiCOM","article_published_time":"2025-09-16T23:30:41+00:00","article_modified_time":"2025-09-16T23:30:42+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png","type":"image\/png"}],"author":"John Cavil","twitter_card":"summary_large_image","twitter_creator":"@PofiiGlobal","twitter_site":"@PofiiGlobal","twitter_misc":{"Written by":"John Cavil","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#article","isPartOf":{"@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/"},"author":{"name":"John Cavil","@id":"https:\/\/www.pofii.com\/blog\/#\/schema\/person\/82dd56bd4b7d1ae512907145b3a68873"},"headline":"WooCommerce Cart Fragments: Stop the AJAX Drag","datePublished":"2025-09-16T23:30:41+00:00","dateModified":"2025-09-16T23:30:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/"},"wordCount":641,"commentCount":0,"publisher":{"@id":"https:\/\/www.pofii.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png","keywords":["AJAX","eCommerce","WooCommerce"],"articleSection":["eCommerce","Hosting Tips &amp; Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/","url":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/","name":"WooCommerce Cart Fragments: Stop the AJAX Drag - Pofii Insights","isPartOf":{"@id":"https:\/\/www.pofii.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage"},"image":{"@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png","datePublished":"2025-09-16T23:30:41+00:00","dateModified":"2025-09-16T23:30:42+00:00","description":"Speed up WooCommerce by taming cart fragments. Disable or delay the AJAX mini-cart, reduce TTFB, and keep checkout working with safe fixes.","breadcrumb":{"@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#primaryimage","url":"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png","contentUrl":"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2025\/09\/stop-ajax-drag.png","width":1280,"height":720,"caption":"stop ajax drag"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pofii.com\/blog\/woocommerce-cart-fragments-stop-the-ajax-drag\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nl.pofii.com\/blog\/"},{"@type":"ListItem","position":2,"name":"WooCommerce Cart Fragments: Stop the AJAX Drag"}]},{"@type":"WebSite","@id":"https:\/\/www.pofii.com\/blog\/#website","url":"https:\/\/www.pofii.com\/blog\/","name":"Pofii","description":"Success Simplified.","publisher":{"@id":"https:\/\/www.pofii.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pofii.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pofii.com\/blog\/#organization","name":"Pofii","url":"https:\/\/www.pofii.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pofii.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2024\/12\/cropped-cropped-pofiiinsights-2.png","contentUrl":"https:\/\/www.pofii.com\/blog\/wp-content\/uploads\/2024\/12\/cropped-cropped-pofiiinsights-2.png","width":2079,"height":221,"caption":"Pofii"},"image":{"@id":"https:\/\/www.pofii.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/PofiiCOM","https:\/\/x.com\/PofiiGlobal","https:\/\/www.instagram.com\/PofiiGlobal","https:\/\/www.linkedin.com\/company\/Pofii"]},{"@type":"Person","@id":"https:\/\/www.pofii.com\/blog\/#\/schema\/person\/82dd56bd4b7d1ae512907145b3a68873","name":"John Cavil","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pofii.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.pofii.com\/brand\/logo-icon-circle-friendly.png","contentUrl":"https:\/\/www.pofii.com\/brand\/logo-icon-circle-friendly.png","caption":"John Cavil"},"description":"WordPress Expert, Head of technical support at Pofii Ltd.","sameAs":["https:\/\/www.pofii.com\/blog\/author\/JohnC"],"url":"https:\/\/www.pofii.com\/blog\/author\/johnc\/"}]}},"_links":{"self":[{"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/posts\/637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/comments?post=637"}],"version-history":[{"count":1,"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/posts\/637\/revisions"}],"predecessor-version":[{"id":638,"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/posts\/637\/revisions\/638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/media\/639"}],"wp:attachment":[{"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/media?parent=637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/categories?post=637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pofii.com\/blog\/wp-json\/wp\/v2\/tags?post=637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}