How to load WordPress in a few milliseconds using Redis

My solution below will cache all the HTML output in Redis and display it without the need to load WordPress.

Installing Redis

If you are using Debian then just:
apt-get install redis-server
Or else, just see the installation instructions.

Using Predis as a PHP client for Redis

You need a client in order to use PHP to communicate with Redis.

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).

Step 1:

Add the code below to a new file called index-with-redis.php and place it in the WordPress root directory.