wordpress - How to Serve Different Elementor Cache Versions Based on WooCommerce Multilingual & Multicurrency Currency S

admin2025-04-17  9

Title:

How to Serve Different Elementor Cache Versions Based on WooCommerce Multilingual & Multicurrency Currency Switcher?

Question:

I am using the XStore theme for WooCommerce, which is running on Elementor. In order to maintain faster site performance, I have enabled Elementor element caching, which creates and stores an HTML version of an element on the server.

Additionally, I am using the WooCommerce Multilingual & Multicurrency plugin (WooCommerce Multilingual), which allows customers to switch between different currencies. The plugin syncs with an exchange service to get the latest currency rates, enabling the customer to choose their preferred currency from the available options.

The Problem:

The issue arises when a cached version is stored in a particular currency, e.g., EUR. When a customer changes the currency to USD, they will still see the cached version in EUR rather than USD. This creates a mismatch between the selected currency and the displayed content.

What I Understand So Far:

As the cache is global, I can’t regenerate the cache every time a single customer switches currencies. The cached content is the same for all users, meaning a change in currency doesn't automatically trigger cache regeneration for that specific user.

What I’m Looking For:

  • How can I serve different cached versions of the same Elementor element depending on the selected currency?
  • Is there a way to create multiple cache versions for each currency or otherwise manage cached content for currency changes?
  • How does this typically work when handling multiple currencies and caching for a site using Elementor and WooCommerce Multilingual & Multicurrency?

Potential Solutions I’ve Considered:

  • I’ve thought about using cache variants for each currency, but I’m not sure how to implement this in Elementor’s caching system.
  • Could I use URL query parameters or cookies to differentiate cache versions per currency?

If anyone has experience solving this type of issue with Elementor and WooCommerce Multilingual & Multicurrency, I’d appreciate your insights.

转载请注明原文地址:http://anycun.com/QandA/1744832194a88238.html