WordPress缓存插件Object Cache Pro v1.21.2开心版
配合Redis使用效果明显
1、上传安装插件
2、添加wp_config.php配置:
define(‘WP_REDIS_CONFIG’, [
‘token’ => ‘Zhanzhangb9sjJlBxBpLJbJcIRoi9rfszjmOqecMzQ1RB3K8jYQAOMkrCFDR’, //随便填写
‘host’ => ‘127.0.0.1’,
‘port’ => 6379,
‘database’ => 0, // 多个WP站点,使用不同的redis数据库,从0开始往后递增。
‘timeout’ => 0.5,
‘read_timeout’ => 0.5,
‘retry_interval’ => 10,
‘retries’ => 3,
‘backoff’ => ‘smart’,
‘compression’ => ‘zstd’,
‘serializer’ => ‘igbinary’,
‘async_flush’ => true,
‘split_alloptions’ => true,
‘prefetch’ => true,
‘debug’ => false,
‘save_commands’ => false,
]);
define(‘WP_REDIS_DISABLED’, getenv(‘WP_REDIS_DISABLED’) ?: false);