Multilingual & Multi-Currency Caching (WPML, Polylang, CURCY & FOX)
Isolate cached HTML cleanly across 8 multilingual plugins (WPML, Polylang, TranslatePress, Weglot, Bogo, qTranslate) and multi-currency switchers (CURCY, FOX/WOOCS, WCML, WooPayments).
- Auto-detects 8 multilingual plugins (
WPML,Polylang,TranslatePress,Weglot,qTranslate-XT,Bogo,WP Multilang,Universally) viaProviderRegistry.php—supporting/ar/subdirectories,fr.example.comsubdomains, and separate ccTLD domains (LanguageDomains.php). - Synchronizes translation-group cache invalidation (
TranslationGroupCapture.php) and multilingual XML sitemaps (including clean decoded Arabic/Unicode URLs inPreload). - Isolates multi-currency prices cleanly across CURCY (
Curcy.php), FOX / WOOCS (FoxCurrency.php), WPML WooCommerce Multilingual (WcmlCookieRenewal.php), WooPayments Multi-Currency, and Price Based on Country (WCPBC). - Hashes recognized variant cookies into deterministic SHA-256 cache buckets (
CookieVariants.php)—raw cookie strings never touch filesystem paths.
Preventing Cross-Language & Cross-Currency Cache Mix-Ups#
International WordPress publications and global WooCommerce stores face two perilous caching failure modes when using generic page-cache plugins:
- Currency Price Poisoning: A European shopper switches your store currency to
EUR (€), triggering a cache rebuild on/product/leather-weekender/—and five seconds later, an American shopper opening that same URL sees€240instead of$260! - Cross-Language & Cross-Domain Asset Errors: A bilingual English + Arabic (
RTL) site using separate domains (example.comandexample.ae) or cookie-driven language switching serves English navigation menus on Arabic URLs, or triggers browserCORSfailures on minified fonts and CSS.
KadiCache Free Core (ProviderRegistry.php, LanguageDomains.php, TranslationGroupCapture.php, Curcy.php, FoxCurrency.php, and WcmlCookieRenewal.php) detects your active multilingual and currency stack automatically with zero manual regex rules.
Native Auto-Detection for 8 WordPress Multilingual Plugins (ProviderRegistry.php)#
ProviderRegistry::current() inspects active WordPress constants and APIs to register the exact LanguageProvider implementation for your site:
| Multilingual Plugin | Free Core Provider Class | Supported URL Topologies & Invalidation Behavior |
|---|---|---|
WPML (ICL_SITEPRESS_VERSION) | WpmlProvider.php | Subdirectories (/de/), subdomains (de.site.com), separate domains, language cookies & trid translation-group purges |
| Polylang & Polylang Pro | PolylangProvider.php | Subdirectories, subdomains, multi-domain origins (LanguageDomains), pll_language cookie variants & linked post purges |
TranslatePress (TRP_PLUGIN_VERSION) | TranslatePressProvider.php | Language URL slugs (/es/, /ar/), RTL output buffers & shared translation invalidation (SharedTranslationInvalidation.php) |
Weglot (WEGLOT_VERSION) | WeglotProvider.php | Translated subdirectory routes & translated HTML output caching |
qTranslate-XT (QTX_VERSION) | QtranslateProvider.php | Pre-path (/fr/), query (?lang=fr), and cookie language modes (QueryLanguageVariants.php) |
Bogo (BOGO_VERSION) | BogoProvider.php | Native WordPress locale routing & translated post invalidation |
WP Multilang (WPM_VERSION) | WpMultilangProvider.php | Locale prefix routing & default-language origin resolution |
Universally (UNIVERSALLY_VERSION) | UniversallyProvider.php | Unified buffer translation caching across configured target languages |
Multi-Currency Isolation Across WooCommerce Switchers#
How a currency switcher stores the visitor’s chosen currency (Cookie vs PHP/WC Session vs GeoIP) determines how KadiCache caches or isolates it safely:
| Multi-Currency Plugin | Storage Mechanism | KadiCache Automatic Handling |
|---|---|---|
CURCY – Multi Currency for WooCommerce (Curcy.php) | wmc_current_currency cookie | Hashed Cache Variant — caches separate USD, EUR, GBP, SAR snapshots at ~14 ms Early HIT speed! |
FOX – Currency Switcher (WOOCS) (FoxCurrency.php) | Cookie mode vs PHP Session / Transient mode | Caches per currency when configured in Cookie storage; safely bypasses shared cache if FOX is left in server-side PHP session/transient mode so prices never mix! |
WPML WooCommerce Multilingual (WCML) (WcmlCookieRenewal.php) | WCML currency & language cookies | Synchronized Variant & Cookie Renewal — serves fast per-currency/per-language variants cleanly |
WooPayments Multi-Currency (WooCommerceSession.php) | Session / Geolocation currency | Detects is_customer_multi_currency_enabled() & auto-currency GeoIP (woo_geolocation_currency / woo_session_currency) |
Price Based on Country (WCPBC) | Country session / AJAX caching mode | Honors wc_price_based_country_caching_support when enabled, or isolates country sessions safely |
Adding Custom Variant Cookies (Tools -> Cookies & Query Rules)#
If your agency builds a bespoke B2B storefront switcher—such as a cookie named store_region (us, eu, uk) or vat_display (incl, excl)—open WP Admin -> KadiCache -> Tools -> Cookies & Query Rules:
# Variant Cookies create separate SHA-256 hashed cache files per cookie value
store_region
vat_display_mode- Important Distinction: Put low-cardinality public preferences (
3–10shared values likeUSD/EUR/GBP) in Variant Cookies. Put unique per-user tokens (likemember_auth_jwt) in Rejected (Bypass) Cookies so you never create thousands of single-user cache files.
Multilingual Sitemap Warmup & Edge CDN Coordination#
To keep every language and regional storefront hot around the clock:
- Automatic Multilingual Sitemap Discovery:
PreloadDiscovery.phpreads translated URL entries emitted by Yoast SEO, Rank Math, WPML Sitemaps, and Polylang automatically—warming/en/,/de/,/fr/, and/ar/pages in bounded batches without manual URL lists. - Cloudflare & Varnish Multi-Domain Sync: When using separate language domains (
example.com,example.de,example.ae),LanguageDomains.phpensures single-post updates purge the matching URL across both local cache and Varnish / Cloudflare edge zones cleanly. - Intact
<link rel="alternate" hreflang="...">& Translated Checkout Paths: Cached HTML snapshots retain every SEOhreflangheader and canonical tag emitted by your translation plugin while keeping translated/kasse/,/panier/, and/سلة-المشتريات/cart/checkout slugs strictly uncached.
Frequently Asked Operational Questions
Does KadiCache support WPML or Polylang configured with separate domains per language (example.com and example.fr)?
Are Arabic, Hebrew, Cyrillic, or Japanese percent-encoded URLs readable inside the Preload queue?
Can malicious requests send random Variant Cookie values to fill up my disk?
When I update an English blog post in WPML or Polylang, do French and Arabic switcher links update too?
Does Cloud Remove Unused CSS support right-to-left (RTL) stylesheets on Arabic and Hebrew pages?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.