- Eliminates uncached
?wc-ajax=get_refreshed_fragmentsrequests for empty-cart visitors viaWooCommerceCartFragments(Smartmode + non-secretkadicache_carthint cookie). - Distinguishes empty default
wp_woocommerce_session_<HASH>cookies from populated carts, geolocation taxes, and customer-specific pricing viaWooCommerceSession::emptyNewSession(). - Isolates multi-currency buckets (
CURCY,FOX / WOOCS,WCML,WooPayments,Price Based on Country) and 8 multilingual engines (WPML,Polylang,TranslatePress,Weglot,MultilingualPress,qTranslate-XT,WP Multilang,Universally). - Protects 8 Express Payment Wallets (PayPal PPCP
kadicache_ppcp_fn, Stripe, Mollie Apple Pay, Square, Revolut, FunnelKit, Airwallex, EasyPayment) and 6 Wishlist plugins.
Table of Contents (5 sections)
- Why Generic WordPress Cache Plugins Break Live WooCommerce Stores
- WooCommerceCartFragments.php: Smart Mode & Native Mini-Cart Support
- WooCommerceSession.php: Deep Session, Tax & Multi-Currency Verification
- Multi-Currency, 8 Multilingual Engines, 8 Express Wallets & 6 Wishlists
- Inspecting Commerce Eligibility & Custom Cookie Rules
Why Generic WordPress Cache Plugins Break Live WooCommerce Stores#
Caching a static blog is forgiving; caching a multi-currency, multilingual WooCommerce store with Apple Pay buttons, dynamic tax geolocation, wishlists, and AJAX mini-carts is where generic caching plugins cause expensive production incidents:
- The
?wc-ajax=get_refreshed_fragmentsBottleneck: Out of the box, WooCommerce fires an uncached AJAX POST to/?wc-ajax=get_refreshed_fragmentson every public page load—even when 94% of browsing visitors have an empty cart. That single request boots full WordPress + WooCommerce in the background, stalling mobile main threads and saturating PHP-FPM workers during ad campaigns. Yet blindly dequeuingwc-cart-fragments(as many "bloat remover" snippets recommend) freezes header cart counters across pages! - Session & Currency Bleed: If a plugin caches HTML while
WCPay\MultiCurrency,FOX,CURCY, or geolocation tax display (woocommerce_default_customer_address = geolocation) stores currency or VAT state inside an opaquewp_woocommerce_session_*row rather than a distinct variant cookie, European shoppers suddenly see USD prices—or worse, another customer's tax calculation. - Broken Express Checkout Buttons & Wishlists: PayPal (
woocommerce-paypal-payments), Stripe Payment Request, Apple Pay, Revolut, and YITH / TI Wishlists inject dynamic client tokens, nonces, or personalized heart states that either silently fail under aggressive Delay JS or poison shared HTML snapshots.
KadiCache treats WooCommerce and multilingual routing as first-class citizens inside 100% Free Core, backed by over 35 dedicated integration classes in src/Integrations/Plugins/ and src/Integrations/Multilingual/.
WooCommerceCartFragments.php: Smart Mode & Native Mini-Cart Support#
Inside WP Admin -> KadiCache -> CSS & JavaScript -> Commerce & Smart Cart, KadiCache gives store owners three explicit modes (cart_fragments_mode) rather than a blunt on/off toggle:
Smart · Recommended:WooCommerceCartFragmentsinjects lightweight browser gate scripts (cart-session.jsandcart-fragments.js) paired with a readable, non-secret expiry timestamp cookie (kadicache_cart) synchronized onwoocommerce_set_cart_cookies,woocommerce_cart_emptied,woocommerce_cart_item_removed, and WooCommerce Store API (rest_post_dispatch) mutations. Visitors browsing with an empty cart fire zero?wc-ajax=get_refreshed_fragmentsrequests; the instant a shopper adds an item to their cart, live fragment synchronization wakes up automatically and clearskadicache_cartagain if the cart is emptied.Original: Retains WooCommerce's native fragment refresh on every load (and automatically excludeswc-cart-fragments-jsfrom Delay JS when Keep delaying scripts for shoppers is enabled so header counters update immediately).Off: Dequeueswc-cart-fragmentscompletely on stores whose themes have no header mini-cart widget at all.
For modern Gutenberg block themes using the woocommerce/mini-cart Interactivity/React block, Native Mini-Cart Cache Support (WooCommerceMiniCartBlock.php) qualifies declared cart counter selectors so even shoppers carrying active carts can continue receiving fast cached product and category pages safely.
WooCommerceSession.php: Deep Session, Tax & Multi-Currency Verification#
Not every wp_woocommerce_session_<COOKIEHASH> cookie means a visitor has items in their cart—extensions frequently initialize an empty guest session on landing. Conversely, an empty cart does not always mean a session is safe to serve from a shared cache!
Multi-Currency, 8 Multilingual Engines, 8 Express Wallets & 6 Wishlists#
KadiCache coordinates variant hashing, targeted stock invalidation (CommerceStockTracker.php), and translation-group purges (TranslationGroupCapture.php) out of the box without manual regex rules:
| Integration Layer | Verified Plugins & Providers in Source Code | How KadiCache Protects Your Store |
|---|---|---|
| Private Commerce Routes | WooCommerce, Easy Digital Downloads, SureCart, MemberPress, LearnDash (PrivateCommerceRoutes.php, MembershipLmsRoutes.php) | Hard-bypasses cart, checkout, account, order-pay, thank-you, and LMS lesson endpoints in both Early and Late paths |
| Multi-Currency Buckets | CURCY (VillaTheme), FOX / WOOCS, WCML (WcmlCookieRenewal), WooPayments, Price Based on Country | Hashes active currency cookies into isolated cache variants and pauses Early serving during curcy_currency_transition |
| 8 Multilingual Providers | WPML, Polylang, TranslatePress, Weglot, MultilingualPress, qTranslate-XT, WP Multilang, Universally | Isolates subdirectory, subdomain, separate-domain, and cookie/query language routes; purges linked translations when stock or prices change |
| 8 Express Payment Wallets | Official PayPal (OfficialPaypal / kadicache_ppcp_fn), Stripe (ThemehighStripe), MollieApplePay, SquareWallet, RevolutExpress, FunnelkitWallet, AirwallexWallet, EasypaymentPaypal | Protects wallet SDK initialization, fraudnet/client tokens, and product-page express checkout buttons from cache or script breakage |
| 6 Wishlist Engines | YithWishlist, TiWishlist, WpcWishlist, MoreconvertWishlist (MoreconvertNonce), WcboostWishlist, QodeWishlist | Prevents personalized wishlist counters/nonces from leaking into shared guest HTML (WishlistReuse.php) and excludes wishlist action URLs from prefetch |
| Stock-Change Invalidation | CommerceStockTracker.php + PurgeTargetResolver.php | Purges only the affected product, parent variable product, and assigned category/shop archives when inventory hits out-of-stock—leaving unrelated products warm |
Inspecting Commerce Eligibility & Custom Cookie Rules#
For stores running bespoke ERP or B2B wholesale plugins, WP Admin -> KadiCache -> Tools -> Cookies & Query Rules exposes granular drawers for Never cache with these cookies, Cache variant cookies (creating isolated cache files per cookie value, such as b2b_tier=gold), Cache query strings, and Ignored query parameters:
# 1. Anonymous guest visit to a WooCommerce product -> X-KadiCache: HIT (14ms)
curl -sI https://example.com/product/chronograph-titanium/ | grep -i "^x-kadicache"
# 2. Simulate active cart cookie -> deterministic policy response with exact reason
curl -sI -H "Cookie: woocommerce_items_in_cart=1" https://example.com/product/chronograph-titanium/ | grep -i "^x-kadicache"
# 3. Full WP-CLI diagnostic report on any shop or translated URL
wp kadicache diagnose https://example.com/shop/ --format=jsonCreator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.