## Wp Redis Cache
Cache Wordpress using Redis, the fastest way to date to cache Wordpress.
### Requirements
------
* [Wordpress](http://wordpress.org) - CMS framework/blogging system
* [Redis](http://redis.io/) - Key Value in memory caching
* [Predis](https://github.com/nrk/predis) - PHP api for Redis
### Installation
------
Install Redis, must have root access to your machine. On debian it's as simple as:
```bash
sudo apt-get install redis-server
```
On other systems please refer to the [Redis website](http://redis.io/).
You can install the pecl extension (faster)
```
apt-get install php5-redis
```
If you don't have the pecl extension installed it will default to use [Predis](https://github.com/nrk/predis).
Move the folder wp-redis-cache to the plugin directory and activate the plugin. In the admin section you can set how long you will cache the post for. By default it will cache the post for 12 hours.
Note: This plugin is optional and is used to refresh the cache after you update a post/page.
Move the `index-wp-redis.php` to the root/base Wordpress directory.
Move the `index.php` to the root/base Wordpress directory. Or manually change the `index.php` to:
```php
<?php
require('index-wp-redis.php');
?>
```
In `index-wp-redis.php` change `$websiteIp` to the IP of your server. If you want to use sockets, change `$sockets` to `true` and enter the path of your socket in `$redis_server`.
*Note: Sometimes when you upgrade Wordpress it will replace over your `index.php` file and you will have to redo this step. This is the reason we don't just replace the contents of `index-wp-redis.php` with `index.php`.
We do this because Wordpress is no longer in charge of displaying our posts. Redis will now serve the post if it is in the cache. If the post is not in the Redis cache it will then call Wordpress to serve the page and then cache it for the next pageload.
### Benchmark
------
I welcome you to compare the page load times of this caching system with other popular Caching plugins such as [Wp Super Cache](http://wordpress.org/plugins/wp-super-cache/) and [W3 Total Cache](http://wordpress.org/plugins/w3-total-cache/).
With a fresh Wordpress install:
Wp Super Cache
```
Page generated in 0.318 seconds.
```
W3 Total Cache
```
Page generated in 0.30484 seconds.
```
Wp Redis Cache
```
Page generated in 0.00902 seconds.
```

徐浪老师
- 粉丝: 8834
- 资源: 1万+
最新资源
- MATLAB计算机视觉与深度学习实战-运行视频
- Hooks-Admin-Typescript资源
- Go Web编程实战派源码-Go资源
- Toolbox DVD 828D V04_07_02_01_安装包_链接地址.txt
- 大学生实验报告:人体细胞培养以及观察
- 本项目是一个基于PyTorch实现的U-Net模型,用于生物医学图像分割任务 U-Net是一种卷积神经网络架构,特别适用于处理特征较少且需要浅层特征的医学图像数据集
- likeadmin(PHP版)- MIT协议-免费任意商用- 管理后台_小程序_手机H5_PC端_uni-app-PHP资源
- lunar-javascript-JavaScript资源
- Yearning-SQL资源
- National-Computer-Rank-Examination-计算机二级资源
- 注册电气工程师公共基础-数字电子技术2
- 辽宁石化职业技术学院-Web前端开发职业技能等级证书(初级).zip
- 注册电气工程师公共基础-数字电子技术3
- 注册电气工程师公共基础-数字电子技术4
- 实验一(项目).zip
- ChatGPT-GPTCMS-毕业设计资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


