Shopware redis caching

It's pretty easy to configure caching with redis in shopware6!

On our TurboStack you have redis and redis persistent available. Here is a sample configuration, test thourougly on your shopware version before putting into production.

 

Put a file, e.g. config/packages/redisconfig.yaml

 
framework:  
    session:
        handler_id: "redis:///var/run/redis-persistent/redis.sock/1"
    cache:
        prefix_seed: shopware
        app: cache.adapter.redis
        default_redis_provider: "redis:///var/run/redis/redis.sock/1"
        pools:
            cache.object:
                default_lifetime: 86400
                adapter: cache.app
                tags: cache.tags
            cache.http:
                default_lifetime: 86400
                adapter: cache.app
                tags: cache.tags
            cache.tags:
                adapter: cache.app

 

Another extended configuration which

 
framework:
    session:
        handler_id: "redis:///var/run/redis-persistent/redis.sock/1"
    messenger:
        transports:
            default:
                dsn: "redis://localhost:6378/messages/symfony/consumer?delete_after_ack=true&delete_after_reject=true&dbindex=2"
    cache:
        prefix_seed: shopware
        app: cache.adapter.redis
        default_redis_provider: "redis:///var/run/redis/redis.sock/1"
        pools:
            cache.object:
                default_lifetime: 86400
                adapter: cache.app
                tags: cache.tags
            cache.http:
                default_lifetime: 86400
                adapter: cache.app
                tags: cache.tags
            cache.tags:
                adapter: cache.app 
shopware:
    cache:
        invalidation:
            delay: 0
            count: 150
    cart:
        expire_days: 21
        redis_url: "redis:///var/run/redis-persistent/redis.sock/3"


Was this article helpful?

mood_bad Dislike 0
mood Like 1
visibility Views: 14159