I’m running WPML on a SiteGround-hosted site and I’m having trouble keeping SiteGround’s Memcached persistent object cache enabled and stable. After a few hours, the object-cache drop-in disables itself by renaming to object-cache-crashed.php.
When it crashes, I see approx. 100–200 entries in the PHP error log like:
Right after these log lines appear, the drop-in renames itself to object-cache-crashed.php. Based on SiteGround’s drop-in logic, this seems to happen when Memcached returns an “item too large” condition (per-item size limit), so I suspect WPML sometimes generates cache values that exceed SiteGround’s Memcached per-item limit (?)
Could you confirm:
1. Does WPML 4.8.6 still support (or is it known to work reliably with) SiteGround’s Memcached object cache implementation?
2. Are there any settings, filters, or recommended configuration changes to reduce/avoid large cache entries (e.g. related to URL conversion caching) so SiteGround’s Memcached can be used reliably with WPML?
I’d like to be sure there are no workarounds before I permanently give up on, and disable SiteGround Memcached, which is a pity since persistent object caching can be a significant performance win!
Thanks in advance for your thoughts.
Kind regards,
Erik Molenaar
P.S. Developer-to-developer replies are more than welcome, feel free to go full geek on me 🙂
Thank you for contacting the support forum. I am Sumit from WPML dev team.
I have checked our code, and this cache is created when translating the URLs i.e. from default to other languages.
We uses a common key "WPML_WP_Cache__group_keys" that holds multiple sub key and real data inside those keys e.g.
WPML_WP_Cache__group_keys => convert_url => internal_key => URL value.
By default, Memcached can hold 1 MB of data. On my local I found the cache is not even created so the question is why your site is having so much of URL translation.
This function is used during the post-translation, and the cache is cleared, thus I don't have the data.
I need to find out why we have so much of data.
I would suggest the following
1. First, clear the object cache and see if issue happens again. This is becasue sometimes it could be corrupted data that WPML is unable to clear and it is stuck there. This could be a temporary issue.
2. If the first step does not fix the issue. Please provide me access to the site and permission to use custom code on the site to see the cache objects. I will also use printf debugging to see who is calling frequent URL translations.
Since you are developer, FYI, here it is created in \sitepress-multilingual-cms\classes\url-handling\converter\class-wpml-url-converter-factory.php:L146