![优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图 优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图](https://blog.eswlnk.com/wp-content/uploads/wpcy/16be6158e2271c5e5d88f907f0e276d8.jpg)
为了让访问者有更好的访问体验,我决定对对「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 优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图1](https://static.eswlnk.com/2023/02/20230219171358249.png)
加载时间
![优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图2 优化日志:PHPRedis 添加 Zstd 和 Igbinary 支持插图2](https://static.eswlnk.com/2023/02/20230219172726909.png)
后续
目前「serializers」的 「igbinary」,后续研究后会使用它