October 29, 2020 at 1:20 pm #28681Richard DadismanGuest
We are running WP 5.5.1, with WPML, and W3 Total Cache 0.15.1.
We are not using the WPML extension.
I configured the cache settings per the guide on WPML’s website.
We are in a clustered environment behind a load balancer.
In WPML we have the root site blog.ariix.com mapped to US English without a language code. Each of the other languages utilize locale codes such as /en-gb or /de-de for UK English and German in Germany respectively. So the front page of the blog in the UK would be blog.ariix.com/en-gb.
After the W3 Cache is enabled for a few hours when visiting blog.ariix.com we will be redirected to a random localized version of page such as blog.ariix.com/en-gb or blog.ariix.com/de-de.
If I flush the cache or disable the cache plugin the issue goes away for a period of time. Additionally, the issue only occurs on on the front page of the blog.
Front page caching is enabled.
I added a sitemap for the posts to preload the cache
All of the caching is using basic disk caching as company policy prevents us from having write access to the .htaccess file
We have not seen this issue occur on the staging or dev environments which are both single instancesOctober 29, 2020 at 2:19 pm #28695Jesse OwensKeymaster
I can think of a couple things you might try before you decide to upgrade to use the WPML extension.
First, since you mentioned the issue is resolved if you purge the cache, you might consider automatically priming the page cache at a certain interval based on your traffic. Navigate to Performance > Page Cache > Cache Preload and enable the option to automatically prime the cache. Try the default value of 900 seconds, and adjust according to your needs.
Depending on the way you have your clustered environment set up, you might also have success enabling the option to Cache alias hostnames and add your mirrors into the list of additional home URL’s.October 29, 2020 at 4:56 pm #28701Richard DadismanGuest
We have the preload enabled for the page cache and we also provided a URL to a Yoast site map files for all of the posts.
It looks like unchecking the “Cache front page” check box may have solved it.
I unchecked that, main page is still getting cached (I can see the cache key in the source at the bottom of the page) and we have not seen the issue return since making that change.
Fingers crossed that was the issue.October 29, 2020 at 4:57 pm #28707Jesse OwensKeymaster
Thanks for letting us know how you solved it! I’m glad to hear that you’ve found a potential solution. Please let us know if you have any more trouble, we’re happy to help.
- The topic ‘WPML Site loads in the wrong locale’ is closed to new replies.