APO: WordPress plugin WPML with language cookie for non-login users

The multi-language plugin WPML adds the cookie called “wp-wpml_current_language” for non-login users to support AJAX filtering. This cookie makes the users bypass the APO cache (Automatic Platform Optimization) because of the name “wp-” part. The first page load without the cookie can hit the cache, but the second load is always bypassed.

Could you consider adding support for this plugin? Thank you!

For users that are not logged-in, WPML checks if this setting is turned on and if so, the language cookie is set using JavaScript. This allows WPML to set the language cookie even if the site is cached.
https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/

wp-wpml_current_language – Stores the current language. By default, this cookie is set only for logged-in users. If you enable the language cookie to support AJAX filtering, this cookie will also be set for users who are not logged in.
https://wpml.org/documentation/support/browser-cookies-stored-wpml/

Sounds reasonable, we can add it so the requests with wp-wpml_current_language will be served from the cache.

2 Likes

@yevgen Thank you so much! Very exciting to hear that!

The change is live.

@yevgen A page with the cookie “wp-wpml_current_language” still doesn’t hit the cache but I will let you know when it starts working. Thank you so much for your work.

We will deploy a fix early next week.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

The change is live.

1 Like