简介
Redis Cache Pro是一款企业级的Redis对象缓存优化WordPress插件,Object Cache Pro已针对WooCommerce进行了广泛的测试和优化,与WordPress本身紧密集成,并且仪表板小部件使交互变得容易。
官方网站
官网:https://objectcache.pro
官方说明文档:https://objectcache.pro/docs
官方更新日志:https://objectcache.pro/docs/changelog
插件功能
- 为原始性能重写
- 符合 WordPress 对象缓存 API
- 易于调试和记录
- 缓存预取和分析
- 完全单元测试(100% 代码覆盖率)
- 使用 TLS 进行安全连接
- 通过 WordPress 和 WP CLI 进行健康检查
- 针对 WooCommerce、Jetpack 和 Yoast SEO 进行了优化
Redis Cache Pro与其他缓存插件对比
![图片[2]-Redis Object Cache Pro – 企业级Redis对象缓存wordpress插件v1.24.2 图片[2]-Redis Object Cache Pro – 企业级Redis对象缓存wordpress插件v1.24.2](https://pdha.top/wp-content/uploads/pdha.top/2025/10/1759805258936.png)
使用教程
在站点根目录下的文件wp-config.php里加入如下代码
define('WP_REDIS_CONFIG', [
'token' => 'e279430effe043b8c17d3f3c751c4c0846bc70c97f0eaaea766b4079001c',
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
'maxttl' => 3600 * 24 * 7,
'timeout' => 1.0,
'read_timeout' => 1.0,
'prefetch' => true,
'split_alloptions' => true,
'strict' => true,
'debug' => false,
]);
define('WP_REDIS_DISABLED', getenv('WP_REDIS_DISABLED') ?: false);
成功启动后,WordPress的缓存效果显著,速度非常快,大家可以自己体验!
![图片[3]-Redis Object Cache Pro – 企业级Redis对象缓存wordpress插件v1.24.2 图片[3]-Redis Object Cache Pro – 企业级Redis对象缓存wordpress插件v1.24.2](https://pdha.top/wp-content/uploads/pdha.top/2025/10/1759805259168.png)
如果启用后,后台报错,请按照下方进行修复
修改文件/wp-content/plugins/object-cache-pro/src/Clients/Client.php
修改87行到99行
原文:
/**
* Forwards all calls to registered callback.
*
* @param string $method
* @param array $arguments
* @return mixed
*/
public function __call($method, $arguments)
{
return $this->{$this->callback}(function () use ($method, $arguments) {
return $this->client->{$method}(...$arguments);
}, strtolower($method));
}
替换为:
/**
* Forwards all calls to registered callback.
*
* @param string $method
* @param array $arguments
* @return mixed
*/
public function __call($method, $arguments)
{
return $this->{$this->callback}(function () use ($method, $arguments) {
// 临时修复Redis::info参数过多
if (strtolower($method) === 'info' && count($arguments) > 1) {
$arguments = array_slice($arguments, 0, 1);
}
return $this->client->{$method}(...$arguments);
}, strtolower($method));
}
下载地址
感谢您的来访,获取更多精彩文章请收藏本站。
© 版权声明
THE END







![WordPress换域名、批量修改替换网站链接URL最完美教程[新手必看]-胖大海博客资源网](https://oss.zibll.com/zibll.com/2023/09/图片-22.png?x-oss-process=image%2Fquality,q_40%2Fresize,m_fill,w_1024,h_444)







暂无评论内容