4 ms·
The russian doll cache looks awesome, but I'm a bit worried about this bit in dhh's explanatory article : > The beauty of that system is that you just don’t ca
by oelmekki 13y ago
The russian doll cache looks awesome, but I'm a bit worried about this bit in dhh's explanatory article :
> The beauty of that system is that you just don’t care. Memcached will automatically evict the oldest keys first when it runs out of space
Well, I do care : I use redis as cache backend. I guess it will not be as simple as that.
- oelmekki 13y agoTo 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).