跳到内容 跳到侧边栏

本主题包含 0 則回覆 ,有 0 声音 。

最后由 insiaT 5 months前 更新。

协助者:: Noman.

作者 帖子
2025 年 11 月 18 日 于 下午 3:47 #17588743

insiaT

Background of the issue:
I am trying to improve page speed performance on zeetim.com. Our hosting support identified that the plugin sitepress-multilingual-cms sets a wp-wpml_current_language cookie on every page load, even for logged out users. They tested a filter provided by WPML called wpml_should_skip_saving_language_in_cookies, and when this filter returns true, caching works correctly and the site loads faster. They created an mu-plugin on our staging site to test this, and the cache starts working as expected when the cookie is not set. Link to a page where the issue can be seen: 隐藏链接

Symptoms:
The wpml_current_language cookie forces cache to be bypassed, which slows down page delivery. I expected full page caching for logged out visitors without the wpml_current_language cookie being set, so that performance is improved and cache hits are consistent.

Questions:
Can using the wpml_should_skip_saving_language_in_cookies filter cause other issues on multilingual sites?
What is the correct and recommended way to prevent WPML from always setting this cookie for logged out users?