WordPress使用Redis加速网站

    Read

一、安装redis:

二、调用Predis:

I recommend Predis. Upload predis.php to the WordPress root directory. See more about Predis on Github (if you use a newer version of Predis you need also to modify the script below).SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-MySQL/

点击下载Predis.php代码

ShowHide

链接: http://pan.baidu.com/s/1i4Ie2Tf 密码: a8mn

SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-mysql/

三、Installing the PHP script for the Frontend Cache:

展示index-with-redis.php代码

ShowHide

SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-mysql/

四、执行步骤

①:安装+运行redis;
②:下载predis.php到wordpress根目录;
③:index-with-redis.php改名为index.php;
④:链接: http://pan.baidu.com/s/1i4Ie2Tf 密码: a8mn SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-mysql/

五、结果对比

未安装:


安装后:
SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-mysql/

六、测试说明

未开启redis的时候,每次请求网站的时候都会请求mysql,而开启redis后,第一次请求会请求到后端的mysql,以后的内容都缓存到了redis中。 SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-mysql/

参考文档:
1:https://www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
2:http://www.jeedo.net/lightning-fast-wordpress-with-nginx-redis/SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-mysql/ SourceByrd's Weblog-https://note.t4x.org/environment/wordpress-redis-mysql/

Today in History
April
14
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!
Byrd
  • by Published on April 14, 2017
  • 原文链接:https://note.t4x.org/environment/wordpress-redis-mysql/
匿名

Comment

Anonymous

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: