WPML + multi domain cache clean-up
-
We are using LSCWP on a Woocommerce store that uses WPML for multi language. It is configured in a way that every language is on it’s own domain (1 primary language + 2 additional languages = total 3 domains). This is on single WP installation (NOT a multi-site) and it works fine at first glance except:
- If I purge all cache, it only purges the cache of the domain where I am logged-in. If I want to purge all caches from all three domains, I have to log-in to wp-admin on every domain and click purge all
- all JS and CSS files are loaded on all domains from default language domain (e.g. example.com), even if user is visiting otherdomain.com (e.g. https://example.com/wp-content/litespeed/js/69ec2a34e5d93e4eca8d2b7db5376f5a.js?ver=ba5b8). It would not be a problem but when something changes on the default language, a new JS / CSS files are generated while other languages still have old css/js URLs cached which breaks these sites and produces 404 errors for those JS / CSS requests. The only solution is to log-in in wp-admin on every single domain and click “purge all” so it builds a new cache with updated JS/CSS urls
I searched for any advice, some say that Toolbox > Purge > “Empty entire cache” should clear cache for all pages, but it does not – it only clears cache of the current domain, I still have to manually log-in to wp-admin on every secondary domain and click purge all for cache to be cleared. Note that this is not a multi-site WP installation but WPML that serves different language on every domain.
Is there any workaround so all three domains cache would be cleared when default language’s domain cache changes? Maybe some hook where I can manually force all domain’s caches to be cleared when there is a change in one of them? That would be sufficient – I realize it’s not an optimal solution, but still better than users coming to other domains and getting 404 errors and javascript not working for them.
Is there any way for JS / CSS files to be loaded from the domain where user is visiting and not from default language’s domain?
I already tried Toolbox > Debug settings > Disable all features, but it disables those features only on default language domain while other domains/languages still serve obsolete cached copies of the website.
- The topic ‘WPML + multi domain cache clean-up’ is closed to new replies.