WordPress使用Redis加速网站

一、安装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).文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/environment/wordpress-redis-MySQL/

点击下载Predis.php代码

ShowHide

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

文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/environment/wordpress-redis-mysql/

三、Installing the PHP script for the Frontend Cache:

展示index-with-redis.php代码

ShowHide

文 章 源 自 note.t4x.orgByrd's Blog-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 文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/environment/wordpress-redis-mysql/

五、结果对比

未安装:


安装后:
文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/environment/wordpress-redis-mysql/

六、测试说明

未开启redis的时候,每次请求网站的时候都会请求mysql,而开启redis后,第一次请求会请求到后端的mysql,以后的内容都缓存到了redis中。 文 章 源 自 note.t4x.orgByrd's Blog-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/文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/environment/wordpress-redis-mysql/ 文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/environment/wordpress-redis-mysql/

申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!

On this day in past years
April
14
 
Byrd
  • by Published onApril 14, 2017
  • 原文链接:https://note.t4x.org/environment/wordpress-redis-mysql/
匿名

Comment

Anonymous

Slide puzzle verification.