|
一直用wordpress做博客,而且不喜欢备案,所以只能放在海外,但是海外的主机访问速度不给力,使用了xcache和eAccelerator效果不佳,后来使用了redis这个kv缓存服务后,速度明显的提高5-6倍
</div><p><strong>1.在v<a href="/fw/photo.html" target="_blank">ps</a>主机上安装redis</strong></p>
<p>①我用的LNMP包,里面自带了redis,执行 ./redis.sh 就可以自动安装并加入自启动</p>
<p>②单独安装redis-server</p>
<p># apt-get install redis-server<br />
启动redis-server,并加入自启动项目(具体方法请自行查阅,因为部分linux上的方法是不同的)</p>
<p><strong>2.在wordpress中增加redis-Server的PHP客户端</strong></p>
<p>大家都推荐使用predis.php(下载地址),将predis.php上传到wp的根目录</p>
<p><strong>3.下载wp使用redis的新首页</strong></p>
<p>index-with-redis.php(下载地址),将原来wp中的index.php备份,修改index-with-redis.php为index.php</p>
<p>4.根据个人需求修改index-with-redis.php中的参数<br />
// change vars here<br />
$cf = 1; // set to 1 if you are using cloudflare<br />
$debug = 0; // set to 1 if you wish to see execution time and cache actions<br />
$display_powered_by_redis = 1; // set to 1 if you want to display a powered by redis message with execution time, see below</p>
<p><strong>5.上传到wp根目录,刷新网页即可</strong></p>
<p><strong>注意:如果wp升级了,那上述步骤中的两个文件需要重新设置一下</strong></p>
<p>接下来快去升级和加速你的wordpress站点吧,别犹豫了。 |
|