Why is Memcached Object Cache not working in W3TC Plugin for WordPress via CLI?
-
I am using W3 Total Cache Plugin in WordPress and setted up Object-Cache to use Memcached.
I created a test file which should store the result of a complex operation via wp_cache_set() and will use it in future script calls via wp_cache_get() to save execution time. Everything is working fine when i call the script via browser on first call it’s generated and then loaded from cache (i know it because i added a cache_status field to my json output and of course i see that first call is much slower).
The problem is that when i call the file via CLI then the cache status is still false in all future calls which means that wp_cache_get() is not able to find the key in memcached server.
I already checked, that Memcached module is enabled in the CLI php.ini and can be used within php scripts.
I think that W3TC might adds some prefix to my memcached key which is based on the environment (maybe hostname or something) which of course is different in cli environment. But i did not find any documentation about that and have no clue how to debug. I found out that item key includes some variables like host, blog_id and module for example but i am not sure where they are defined: https://github.com/crowdfavorite-mirrors/wp-w3-total-cache/blob/master/Cache_Base.php#L190
Setting WP_CACHE_KEY_SALT also did not had any effect.
Does anyone have experience with that kind of problem?
- The topic ‘Why is Memcached Object Cache not working in W3TC Plugin for WordPress via CLI?’ is closed to new replies.