There is a setting in litespeed cache -> cache -> advance: AJAX Cache TTL.
In LS documentation, it says
"Specify an AJAX action in POST/GET and the number of seconds to cache that request, separated by a space. One action-TTL pair per line."
I can set the action to TTL 0, then it's not cached.
This ticket has been moved to our compatibility team so our compatibility specialists can take a deeper look and isolate the cause of the issue with LS cache.
I will keep you updated on the evolution of this ticket.
Please follow these steps:
- Create a full site backup
- Add this code to the functions.php file located within the active theme folder:
// Use Cookie instead of WCSession
add_filter( 'wcml_user_store_strategy', function ( $strategy, $key ) {
return 'cookie';
}, 10, 2 );
- Save the changes
- Go to LiteSpeed Cache -> Cache -> Advanced -> Vary Cookies -> add wcml_client_currency
- Save the changes
- Flush all the cache memory
- Double-check if the issue has disappeared
Can you tell me the results of the steps described above?
I saw there is one more cookie: wcml_client_currency_language. Will this one affect the cache vary? I am setting up crawler. I've set up cookie simulations:
wp-wpml_current_language, value: en, de, _null
wcml_client_currency, value: USD, CAD, EUR, GBP, _null
Do I need to add "wcml_client_currency_language" in cache vary and crawler cookie simulation?
1.- Our compatibility specialists suspect this issue is happening on your site and it is not a problem between WPML and LS Cache; however, they have raised this issue to take a deeper look in case there is a long-term solution that can be applied if another situation like this appears.
2.- Regarding the cookie wcml_client_currency_language, did you have any issues or problems with this cookie on your site? Is there any functionality affected related to the currency and this cookie?
I've changed to use "CURCY - WooCommerce Multi Currency Premium" for multicurrency. It can solve the cache miss issue. According to litespeed, with your plugin, it's not possible to solve the cache hit issue for first page load. It's always miss cache.
You may check curcy's solution and use its solution.