EmanueleMinotto / TwigCacheBundle

Symfony Bundle for asm89/twig-cache-extension
59 stars 13 forks source link

Redis Setup #4

Closed 2case closed 9 years ago

2case commented 9 years ago

It was a little bit tricky to setup the cache with redis as backend. Just in case u search for this also here my solution. You have to define two services, one for redis the other for the cache service as described:

Vendor/Bundle/Resources/services.yml
    services:
        vendor.bundle.cache.redis:
            class: Redis
            calls:
                - [ connect, [ 'localhost' ]  ]

        vendor.bundle.cache.twig:
            class: Doctrine\Common\Cache\RedisCache
            calls:
                - [ setRedis, [ '@vendor.bundle.cache.redis' ] ]
EmanueleMinotto commented 9 years ago

Check the https://github.com/doctrine/DoctrineCacheBundle#redis configuration, maybe it's more simple. I close this issue because it's related to the Redis/Doctrine cache setup, not the TwigCacheBundle.