Sumit
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
|
Hi John,
Thanks for the feedback. Our cookie name is "wcml_client_currency" and we set it only when explicitly defined by the filter https://wpml.org/wcml-hook/wcml_user_store_strategy/ otherwise we use WC session to store the currency.
I am not sure why the cookie "wcml_currency" is being set. Are you using some kind of custom code/plugin?
Please let us know if htaccess code fixes the issue otherwise finding that cookie code and removing it should fix the issue.
Thanks
|
John
|
Hey, I have just tested but it doesn't work.
Also please don't forget that all the tests are made on the default theme with wpml and LiteSpeed module active so we can exclude other incompatibilities.
Wouldn't be more easy to communicate with Litespeed dev directly so there won't be this kind of ping pong between us? Thanks 😀 and hope you understand.
All the best!
|
Sumit
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
|
Hi John,
Yes, I understand but I was asking you to contact LiteSpeed as you are a customer and it will be more faster than us.
Anyway, I can see there is no resolution to your problem so I decided to debug this further in LiteSpeed plugin and found the problem.
After enabling the LiteSpeed logs I can see that cookie "wcml_currency" is being set but this cookie name does not exist in our entire plugin 🙂
After checking the LiteSpeed cache plugin code I found it is being set from LiteSpeed itself see here \plugins\litespeed-cache\thirdparty\wcml.cls.php
public static function apply_client_currency( $currency ) {
if ( $currency !== wcml_get_woocommerce_currency_option() ) {
self::$_currency = $currency;
add_filter( 'litespeed_vary', __CLASS__ . '::apply_vary' );
}
return $currency;
}
public static function apply_vary( $list ) {
$list[ 'wcml_currency' ] = self::$_currency;
return $list;
}
As per this code, this seems to be expected behavior. They are setting a vary "wcml_currency" to create cache per currency meaning changing the currency or closing the browser will reset the cache.
If they have added this that means there was some currency issue with caching.
I am not sure what we can do here because if this is by design then only LiteSpeed can improve this.
I will ask our compatibility team to reach LiteSpeed regarding this question but if you wish you can also ping them and please ask them to send your query to the development team. This is not the support question anymore.
For, now I have made a minor change to bypass this class in the LiteSpeed plugin (same file) and the issue is fixed but not sure if there will be any problem regarding the currency.
I will update you as soon as we have any updates.
Thank you for your understanding.
|
John
|
Sumit, what I can say more: You are the man here!
I appreciate how you decided to handle this issue, which I'm pretty sure other customers have experienced but maybe didn't observe.
As always I will forward your messages to them, and I hope they can also come up with a better solution.
Many thanks again and appreciate that you explain to us what is going on. 😀
Have an awesome week ahead! Keep in touch!
|
Sumit
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
|
Thank you for the wonderful feedback! 🙂
I have already asked our team to contact them. I will keep you posted.
Have a nice week you too!
|
Sumit
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
|
Hi,
Our compatibility team contacted LiteSpeed and we got the response. As expected this is by design.
To make the Multicurrency work properly LiteSpeed uses a cookie per currency and creates a cached version of the page per currency when you close the private/incognito window the cookie is deleted and no cached page is served on the new request.
Furthermore, they said
while our developers are still exploring all possibility but we don't really have any solid solution right now 🙁
So you need to wait for the solution from them in future. Also, our developers suggested the same approach to use cookies to avoid problems with multicurrency. I am sorry but this is all we can do for now. However, I would give my personal opinion here that this should not create a huge impact on your site. Let me explain why, right now you are testing with a private window that always clears the cookie on closing the window. In real life, people usually do not use it. So when a normal user visits your site the first time they will see a non-cached version of the page (first slow response) and after that cached version (faster) will be served also if they revisit they will see the cache version as well.
I would suggest ignoring this problem for now as this is the most used approach by many cache plugins and recommended method by us as well.
Plugins vendors always work for improving things and I hope this will improve in the future.
Thank you!
|