doukui9491 2019-05-15 10:21
浏览 106

为什么Memcached对象缓存无法通过CLI在Word3的W3TC插件中运行?

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
    • ¥15 C# datagridview 单元格显示进度及值
    • ¥15 thinkphp6配合social login单点登录问题
    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配