Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is trying to implement Redis cache on their website to improve load times but is experiencing issues with comments not being filtered by language in widgets and backend updates. Additionally, switching languages in the Menu-build section sometimes causes the menu to disappear.
Solution:
We recommend setting up and translating your website with WPML before enabling Redis cache to avoid such issues. To resolve the current issues, please add the following code to your theme's functions.php file:

wp_cache_add_non_persistent_groups('comment');

And add this line to your wp-config.php file:

define('WP_REDIS_IGNORED_GROUPS', ['WPML_Cache_Terms_Per_Lang', 'terms', 'nav_menu_relationships']);

This solution might not be relevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Dražen 2 years, 2 months ago.

Assisted by: Dražen.

Author Posts
May 16, 2023 at 1:08 pm #13656667

Jaap

Tell us what you are trying to do?

- I want to implement Redis cache om my website to speed up the load times.

Is there any documentation that you are following?

- Yes. I searched a lot online to find a solution for my problem. I installed Redis properly and found a document on excluding groups to prevent caching Buddypress for example.

Is there a similar example that we can see?

- not sure

What is the link to your site?

- hidden link

The issue I am experiencing is subtle, but annoying. Once I enable Redis cache, the speed increase is obvious. But comments are no longer filtered in the widget on the font page. I configured the widget to show comments, filtered by language. That way, only relevant comments are shown.

Also: in the backend I noticed that comments don't update properly. (Only the main language). Only when I go to the comment-section in the sidebar, I see all comments ánd after I go back, the new ones from the other language appear.

Another thing that sometimes happens, is that switching languages in the Menu-build section, makes the menu dissapear sometimes.

If I disable Redis Cache, all issues are gone.

I hope you can help me.

Best regards,

Jaap

May 17, 2023 at 11:34 am #13663749

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Jaap,

thanks for contacting us.

Some issues can arise when using Object cache and WPML, thus we recommend translating and setting up your website with WPML before enabling Object cache. If you do translations and etc with it enabled, it can sometimes cause some issues.

For those you mentioned: menus, and comments, please try to add the next rules to exclude them. It should help and the issue not happening:

- add to theme functions.php

wp_cache_add_non_persistent_groups ('comment');

-Add to wp-confing.php define

( 'WP_REDIS_IGNORED_GROUPS', ['WPML_Cache_Terms_Per_Lang', 'terms', 'nav_menu_relationships']);

Hope it helps, let us know how it goes.

Regards,
Drazen