【使用redis让您的位置】使用redis让您的wordpress博客加速五倍

更新时间:2019-09-19    来源:WordPress    手机版     字体:

【www.bbyears.com--WordPress】

1.在vps主机上安装redis

①我用的LNMP包,里面自带了redis,执行 ./redis.sh 就可以自动安装并加入自启动

②单独安装redis-server

# apt-get install redis-server
启动redis-server,并加入自启动项目(具体方法请自行查阅,因为部分linux上的方法是不同的)

2.在wordpress中增加redis-Server的PHP客户端

大家都推荐使用predis.php(下载地址),将predis.php上传到wp的根目录

3.下载wp使用redis的新首页

index-with-redis.php(下载地址),将原来wp中的index.php备份,修改index-with-redis.php为index.php

4.根据个人需求修改index-with-redis.php中的参数
// change vars here
$cf = 1; // set to 1 if you are using cloudflare
$debug = 0; // set to 1 if you wish to see execution time and cache actions
$display_powered_by_redis = 1; // set to 1 if you want to display a powered by redis message with execution time, see below

5.上传到wp根目录,刷新网页即可

注意:如果wp升级了,那上述步骤中的两个文件需要重新设置一下

接下来快去升级和加速你的wordpress站点吧,别犹豫了。

本文来源:http://www.bbyears.com/wangyezhizuo/68693.html