4 ms·
To answer myself : it's possible to use a maxmemory-policy=volatile-ttl directive to tell redis to remove older keys. Problem is, it's not reliable at all : it
by oelmekki 13y ago
To answer myself : it's possible to use a maxmemory-policy=volatile-ttl directive to tell redis to remove older keys. Problem is, it's not reliable at all : it will actually take a bunch of unpredictable keys and remove the oldest in the set.
http://stackoverflow.com/questions/9010789/configuring-redis-to-consistently-evict-older-data-first http://stackoverflow.com/questions/9010789/configuring-redis...
I currently empty redis cache on each deployment, so that's not really a problem, but it will be when I use a less naive cache invalidation on code update (and I'm pretty sure some of you are).
So, we'll probably have to take a look in rails cache internal and force sweeping when computing a new key (this will not be a major problem on redis, since it supports wildcards in key names).