How to connect Redis Cache to Nextcloud

Hello,

i have activated the Redis cache at m y hosting providers control panel. Now i’m trying to figure out how to connect it to my nextcloud server.

My webpage is loading really slow approximetely15 seconds. So i tought this one will help to speed it up.

Thank you for your support!

Did you try this manual?
https://docs.nextcloud.com/server/18/admin_manual/configuration_server/caching_configuration.html#id2

Do you get a link for the redis server and also the port?

If yes, you havce to enable it into youre config.php:

'memcache.locking' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => true,
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'redis' => 
array (
  'host' => '<location>',
  'port' => <port>,

Yes, ive already tried it.

Yes, ive received this one: /data/sockets/redis/e104944-2286.sock

Can you try this one:

'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
 'host'     => '/data/sockets/redis/e104944-2286.sock',
 'port'     => 0,
 'dbindex'  => 0,
],

OK i will make teh test page but where should i write this ?

‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘redis’ => [
‘host’ => ‘/data/sockets/redis/e104944-2286.sock’,
‘port’ => 0,
‘dbindex’ => 0,
],

should i write it inside teh page config.php?

Yes, you have to write that in you’re config.php file.

OK so I gave in into the config.php file but i’m not shore if it is the correct position.

<?php

$CONFIG = array (
‘instanceid’ => ‘’,
‘passwordsalt’ => '
’,
‘secret’ => '
*********’,
‘trusted_domains’ =>
array (
0 => '
’,
1 => ‘**************’,

‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘redis’ => [
‘host’ => ‘/data/sockets/redis/e104944-2286.sock’,
‘port’ => 0,
‘dbindex’ => 0,
],

),
‘datadirectory’ => ‘/data/web/e104944/html/newcloud/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘18.0.1.3’,
‘overwrite.cli.url’ => ‘htt***************’,
‘dbname’ => ‘’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => '
’,
‘dbpassword’ => '
’,
‘installed’ => true,
‘mail_domain’ => '
’,
‘mail_from_address’ => ‘support’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_smtpsecure’ => ‘ssl’,
‘mail_smtphost’ => 'smtp.e
**********’,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtpauth’ => 1,
‘mail_smtpport’ => ‘465’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_smtpname’ => ‘’,
‘mail_smtppassword’ => '
********************’,
‘maintenance’ => false,
‘knowledgebaseenabled’ => false,

);

i also created the optest.php file, but where can I see if it is workign or not ?

It doesn’t matter where u putt it. If you go to:
https://domain.tld/optest.php you will see on the third en fourth tab the scripts of NextCloud

If you want you can send me the url by PM so I can take a look.

Fresh example of my config

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "***REMOVED SENSITIVE VALUE***",
            "2": "***REMOVED SENSITIVE VALUE***"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***\/nextcloud",
        "dbtype": "mysql",
        "version": "18.0.3.0",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "filesystem_check_changes": 0,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 1.5
        },
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": "",
        "logfile": "\/SOMEFOLDER\/data\/nextcloud.log",
        "loglevel": 1,
        "trashbin_retention_obligation": "14, auto",
        "versions_retention_obligation": "14, auto",
        "data-fingerprint": "***REMOVED SENSITIVE VALUE***",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "preview_max_x": 1920,
        "preview_max_y": 1080,
        "auth.bruteforce.protection.enabled": true,
        "simpleSignUpLink.shown": false,
        "mail_smtpsecure": "tls",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "admin"
        ],
        "twofactor_enforced_excluded_groups": [],
        "has_rebuilt_cache": true,
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "keeweb",
            "radio"
        ],
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}