搜索
Hi~登录注册
查看: 1442|回复: 0

使用redis让您的wordpress博客加速五倍

[复制链接]

1892

主题

1899

帖子

6406

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
6406
发表于 2015-5-14 13:48:35 | 显示全部楼层 |阅读模式
一直用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站点吧,别犹豫了。
公众微信:idc5ahl
公众QQ:吾爱互联
关注公众微信,公众QQ每天领现金卡密
卡密介绍(http://www.5ahl.com/thread-2182-1-1.html
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 点我注册

快速回复 返回顶部 返回列表