Skip to content
xYnta
Go to websitexynta.com
Search
EN

Enabling Redis caching

Updated on

Redis is a fast cache in memory. A website or plugin that supports Redis stores data in it and becomes faster as a result. With Web Hosting and Reseller Hosting, Redis is off by default; you turn it on yourself in DirectAdmin. With WordPress Hosting, Redis is already available (see below).

  1. Log in to DirectAdmin

    Log in via Single Sign-On from Mijn xYnta, or at https://yourdomain.nl:2222.

  2. Open Redis

    Under Advanced Features, click Redis.

  3. Enable Redis

    Click ENABLE.

Under Status it then says This account has Redis enabled. The path you enter in your website or plugin is shown under Path to redis socket file. To turn Redis off, use DISABLE on the same page.

The Redis page in DirectAdmin with Redis enabled
Redis in DirectAdmin: the status is enabled, with the path to the socket below it (masked in this image).

WordPress Hosting

With WordPress Hosting you do not need to enable Redis: it is already available on the server. In your website or plugin, enter localhost as the host and 6379 as the port; according to xYnta, Redis is shielded per customer there. How to do this in LiteSpeed Cache is explained in Installing LiteSpeed Cache on your WordPress website.

Emptying a Redis database

To empty the cache with Web Hosting or Reseller Hosting, use these commands in the terminal (see Connecting via SSH). If it worked, the terminal shows bool(true).

Empty all Redis databases:

php -r '$r = new Redis(); $r->connect(getenv("HOME") . "/.redis/redis.sock"); var_dump($r->flushAll());'

Empty one database; replace 1 with the database number you set in your website or plugin:

php -r '$r = new Redis(); $r->connect(getenv("HOME") . "/.redis/redis.sock"); $r->select(1); var_dump($r->flushDB());'

Video

Enabling Redis caching in DirectAdminYouTube

Related articles