SymfonyWorld Online 2021 Winter Edition December 9 – 10, 2021 100% Online +20 talks and workshops

New in Symfony 4.4: Redis Cache Improvements

Redis is a popular in-memory data structure store which is used as a database, a cache and a message broker. Redis is also one of the most popular adapters of the Symfony Cache component and we've improved it in Symfony 4.4 with new features.

Added Redis Sentinel support

Contributed by
Stephen Clouse
in #31437.

Redis Sentinel is a distributed system that provides high availability for Redis. It allows you to create a Redis deployment that resists certain kinds of failures without human intervention.

In Symfony 4.4, we've added support for it thanks to the new redis_sentinel option that you can add to the Redis connection DSN:

use Symfony\Component\Cache\Adapter\RedisAdapter;

// set the 'redis_sentinel' parameter to the name of your service group
$client = RedisAdapter::createConnection(

That's all! The only caveat is that Sentinel also requires the Predis library.

Improved Redis Tag Aware Adapter

Contributed by
Andre Rømcke
in #33461.

Tag Aware Adapters are used in Symfony Cache to invalidate caches based on tags instead of expiration time. In Symfony 4.4 we've improved the RedisTagAwareAdapter in several ways:

  • We've lowered the Redis requirement to 2.8 and we no longer require certain phpredis versions;
  • We've raised the 2 billion keys per tag constraint to 4 billion keys per tag, which is the limit of the Redis Set datatype;
  • We've improved the invalidation process to also delete the tag key in order to avoid leaving unused tags that gradually consume more and more memory;
  • We've made the delete operations faster by reducing them to a single round-trip instead of two.
Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.


I have been waiting for this for a long time!
You'll brighten my day! Thanks!

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.