优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图

为了让访问者有更好的访问体验,我决定对对「phpredis」添加 「zstd」和 「igbinary 」的支持,启用新的压缩算法和序列化,搭配上PHP 8.x,页面生成速度得到了大幅度的提升!

日志记录

目标系统:Linux | CentOS Linux release 8.1.1911 (Core)

git clone https://gitclone.com/github.com/phpredis/phpredis.git
cd phpredis
phpize
./configure  --enable-redis-igbinary --enable-redis-zstd --with-php-config=/www/server/php/xx/bin/php-config
// xx 更换为你的php版本
make && make install


// configure: error: Please reinstall the libzstd distribution报错
yum update 
yum install libzstd-devel
优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图1
安装完成后 PHPinfo

加载时间

优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图2

后续

目前「serializers」的 「igbinary」,后续研究后会使用它