A few weeks back, we wrote about how reducing MySQL queries, and suggested that Redis was one available option for those who wanted to take their caching to the next level. Now, a quick tutorial on installing Redis and configuring Wordpress to communicate with Redis as a caching layer.
Redis is an open source data structure store, and it's popular among Wordpress users for its simplicity and highly optimized approach to caching, which can help pages load significantly faster.
Why caching? In a normal Wordpress installation, when a user browses to the index page (index.php
), the MySQL database is queried for the posts within the loop. This is usually pretty quick, but if you have multiple loops or many concurrent users, the sheer volume of database queries can become overwhelming for your VPS. A caching layer like Redis will query the database once and create a plain HTML file that it will serve instead of normal index.php
file, which will boost page loads and dramatically cut back on database queries.
Prerequisites
- A VPS running Ubuntu 16.04
- A working Wordpress installation—check out our previous guides on a bare Wordpress installation, using EasyEngine or Docker.
Step 1. Installing Redis
Redis is available in the default package repositories for all our OS options, so installation is a breeze.
by subscribing to our newsletter.
A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.
If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.