1. Install redis on the vps host
① I use the LNMP package, which comes with redis. Execute./redis. sh to automatically install and add it to self-start
② Install redis-server separately
# Apt-get install redis-server
Start redis-server and add the self-starting Project (refer to the specific method here, because some methods on linux are different)
2. Add the PHP client of redis-Server to wordpress
We recommend that you use predis. php (Download address) to upload predis. php to the wp root directory.
3. Download the new homepage of wp using redis
Index-with-redis.php (Download address), back up index. php in the original wp, change index-with-redis.php to index. php
4. Modify parameters in the index-with-redis.php as needed
// Change vars here
$ Cf = 1; // set to 1 if you are using cloudflare
$ Debug = 0; // set to 1 if you want to see execution time and cache actions
$ Display_powered_by_redis = 1; // set to 1 if you want to display a powered by redis message with execution time, see below
5. Upload to the wp root directory and refresh the webpage.
Note: If the wp is upgraded, you need to reset the two files in the preceding steps.
Next, upgrade and accelerate your wordpress site. Don't hesitate.