Hey everyone,
recently I stumbled across an issue with redis consuming more and more memory due to constant Neos re-deployments. In our project setup each release/deployment gets it’s own Neos.Flow.cache.applicationIdentifier to ensure that the old Neos deployment can use it’s old still warm cache while still serving requests and the new deployment can build it’s new caches without interrupting service for the old one.
Now the issue is, that I missed to implement some kind of clean-up for the old cache keys in redis. In search for a solution I found the collectGarbage method in the BackendInterface which is currently empty for the redis backend.
I would like to implement the collectGarbage for the Neos\Cache\Backend\RedisBackend method to delete all cache-keys that do not match the current Neos.Flow.cache.applicationIdentifier
It will only take effect when you actually call the ./flow cache:collectGarbagecommand. For a redis server serving as cache for multiple Neos instances it is general best practice to select a separate redis database for each instance.
Any thoughts about implementing that feature? Would love to contribute the the Neos/Flow core directly so somebody having the same niche issue might also profit from it.
Greetings from Dresden
Alex