TailTemplate Build stunning websites faster with our pre-designed Tailwind CSS templates

Redis caching engine for CakePHP 3

CakePHP provides various options as an application's caching engine out of the box. CakePHP's documentation is detailed and provides most of the answers we need. But it lacks the information of setting up Redis server itself in a server.

In this tutorial, we will show you how to setup Redis server in a ubuntu 16.04 machine.

Update APT package list

Update the APT package list by running:

sudo apt-get update

Install Redis

Install Redis server on Ubuntu:

sudo apt-get install redis-server

Install PHP Redis extension

sudo apt-get install php-redis

Connect CakePHP to Redis

Now we have Redis running and the PHP extension is ready. We can connect our CakePHP application to the Redis server by providing the configuration setting at https://book.cakephp.org/3.0/en/core-libraries/caching.html#redisengine-options.

End

Redis is an in-memory cache engine, so it is blazing fast. Hope you find this tutorial helpful.