WooCommerce Cart Fragments & Checkout Performance Optimization in 2026
1. Why wc-ajax=get_refreshed_fragments Hurts WooCommerce Stores
If you run a WooCommerce store or digital theme shop behind Cloudflare, you have likely spotted /?wc-ajax=get_refreshed_fragments firing on every single landing page view—even for first-time visitors with an empty cart. Because that AJAX POST bypasses edge page caching and boots full WooCommerce + WordPress PHP sessions, it adds 400–900ms of backend latency right during initial page load.
The cleanest engineering fix is dequeuing wc-cart-fragments on non-storefront informational pages (home, blog, about) or conditionally loading it only when the woocommerce_items_in_cart cookie is present.

add_action( 'wp_enqueue_scripts', function () {
if ( is_front_page() || is_singular( 'post' ) ) {
if ( empty( $_COOKIE['woocommerce_items_in_cart'] ) ) {
wp_dequeue_script( 'wc-cart-fragments' );
}
}
}, 99 );
| Optimization | Impact on TTFB / INP | Safety |
|---|---|---|
| Dequeue wc-cart-fragments when cart empty | -450ms background waterfall | 100% Safe |
| Disable WooCommerce admin marketing bloat | -20% wp-admin memory | Safe |
| High-Performance Order Storage (HPOS) | 3x faster order queries | Standard in WC 8+ |
2. Protecting Checkout Conversion With Scoped Assets & Redis Object Cache
On /cart/ and /checkout/, full-page HTML caching must remain bypassed so session totals stay accurate. That makes Redis persistent object caching essential: keeping shipping zones, tax rates, and product metadata in RAM ensures checkout steps render in under 150ms even during flash sales.
FAQ — Will dequeuing cart fragments break my header mini-cart? Only if a user already has items in their cart—checking $_COOKIE["woocommerce_items_in_cart"] ensures returning shoppers still get live mini-cart updates.