# Mautic Cache Redis config

**URL:** <https://forum.mautic.org/t/mautic-cache-redis-config/20176>\
**Category:** Product Support\
**Tags:** development, mautic-3\
**Created:** [July 15, 2021, 2:32pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176 "2021-07-15T14:32:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.bell](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/a.bell/32/2264_2.png) [@a.bell](https://forum.mautic.org/u/a.bell)\
**Post date:** [July 15, 2021, 2:32pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/1 "2021-07-15T14:32:11Z")

</div>

**Your software**  
My Mautic version is: 3.3  
My PHP version is: 7.3  
My Database type and version is: MySql 5.7

**Your problem**  
My problem is: redis configuration.  
Trying to configure redis as per [documentation](https://developer.mautic.org/?php#cache-bundle)

These errors are showing in the log:  
php bin/console cache:clear -vvv

```auto
// Clearing the cache for the prod environment with debug false

In CacheClearSubscriber.php line 55:

 [Exception]
 Failed to clear RedisTagAwareAdapter

Exception trace:
 at /var/www/html/app/bundles/CacheBundle/EventListener/CacheClearSubscriber.php:55
Mautic\CacheBundle\EventListener\CacheClearSubscriber->clear() at /var/www/html/vendor/symfony/http-kernel/CacheClearer/ChainCacheClearer.php:41
Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer->clear() at /var/www/html/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:111
Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:1005
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:86
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:74
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /var/www/html/bin/console:43

```

Steps I have tried to fix the problem:

I’ve tried various connection strings and looked through the symfony docs for dsn settings  
`redis://[user:pass@][ip|host|socket[:port]][/db-index]`

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [January 13, 2022, 11:32pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/2 "2022-01-13T23:32:11Z")

</div>

Hello,

I am also trying to setup mautic to use Redis so I figured I would use an old post since there is no solution reply.

**Your software**  
My Mautic version is: 4.1.1  
My PHP version is: 7.4  
My Database type and version is: MariaDB 10.3

**Your problem**  
My problem is:  
I am trying to configure Mautic so that it uses Redis instead of filesystem cache. I installed redis-server package on my system as well as php-redis.

These errors are showing in the log:  
[no errors detect in logs]

Steps I have tried to fix the problem:

I have tried to looking into documentation here: [https://developer.mautic.org/?php&\_ga=2.63514735.1361225527.1642110543-284173810.1641816063#configuration](https://developer.mautic.org/?php&_ga=2.63514735.1361225527.1642110543-284173810.1641816063#configuration) and I tried to reverse engineer whats happening (I looked into cache bundle). I also consult Symfony docs to see how to configure a dsn.

I came up with the following configuration I put into app/config/local.php:

```auto
'cache_adapter' => 'mautic.cache.adapter.redis',
'cache_adapter_redis' => array(
        'dsn' => 'redis://<ip>:<port>/<database-index>',
        'options' => array(
                'lazy' => false,
                'persistent' => 0,
                'persistent_id' => null,
                'timeout' => 30,
                'read_timeout' => 0,
                'retry_interval' => 0,
        ),
),
'cache_prefix' => 'pa_',
'cache_lifetime' => 3600

```

But it does not seem to have any effect. When I am using Mautic and regulary inspecting the contents of redis database there is no entries, meanwhile I can see that cache is being generated on the filesystem. What am I doing wrong?

Any help would be much appreciated.

Regards, M.

---

<div class="post-metadata">

**Author:** ![kuzmany](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kuzmany/32/390_2.png) [@kuzmany](https://forum.mautic.org/u/kuzmany)\
**Post date:** [February 23, 2022, 3:35pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/3 "2022-02-23T15:35:52Z")

</div>

This should fixed it [Add RedisAdapter from Symfony4 for CacheBundle by kuzmany · Pull Request #10889 · mautic/mautic · GitHub](https://github.com/mautic/mautic/pull/10889)

---

<div class="post-metadata">

**Author:** ![atsigr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/atsigr/32/6515_2.png) [@atsigr](https://forum.mautic.org/u/atsigr)\
**Post date:** [March 25, 2022, 6:32pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/4 "2022-03-25T18:32:35Z")

</div>

Hei, i have applied the fix on #10889 and stil lsame problem.  
Does anyone have applied succesfully this config redis with mautic and can share the steps and example of the actually working config ?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [January 18, 2023, 6:53pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/5 "2023-01-18T18:53:13Z")

</div>

I would be very interested in seeing a tutorial or being pointed in the right direction to setup Redis to replace the current cache.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [January 23, 2023, 1:25pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/6 "2023-01-23T13:25:21Z")

</div>

Anyone have some experience here ?

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [March 15, 2023, 8:15pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/7 "2023-03-15T20:15:51Z")

</div>

I have the same problem here. 🙂

---

<div class="post-metadata">

**Author:** ![galvani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/galvani/32/8068_2.png) [@galvani](https://forum.mautic.org/u/galvani)\
**Post date:** [April 18, 2023, 2:36pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/8 "2023-04-18T14:36:16Z")

</div>

Hi guys, do you have any log? any exception/warning thrown?

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [May 30, 2023, 6:47am UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/9 "2023-05-30T06:47:04Z")

</div>

@galvani not on my side. There’s just nothing happening.

---

<div class="post-metadata">

**Author:** ![galvani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/galvani/32/8068_2.png) [@galvani](https://forum.mautic.org/u/galvani)\
**Post date:** [July 24, 2023, 3:52pm UTC](https://forum.mautic.org/t/mautic-cache-redis-config/20176/10 "2023-07-24T15:52:10Z")

</div>

Perhaps there is some misconception. The CacheBundle provides stuff to developers, it’s general interface to caching (multiple adapters). **it will not affect where mautic caches its common files** , like templates and compiled container and so on.  
the /var/cache will still be used for most cases.

> If caching is configured within plugins to use this bundle than the adapter selection will make difference.

> this bundle just provides caching to others. it’s upon plugin’s developers whether they implement it.
