Does Redis-store support :size parameter for redis-rails cache? #153

Closed
hrdwdmrbl opened this Issue Oct 29, 2012 · 6 comments

Comments

Projects
None yet
5 participants

For example, from the Rails Guide on caching:

config.cache_store = :redis_store, :size => 64.megabytes

or

config.cache_store = :redis_store, {host: 'localhost', port: 6379, :size => 64.megabytes

It isn't mentioned anywhere, but it should be part of any rails cache store implementation. So, I just wanted to make sure. Thanks.

Contributor

mhoran commented Nov 15, 2012

I don't believe we've implemented anything on the redis-store side, so unless this is provided by the upstream libraries, we'll need to add this support ourselves.

Yeah. I poked around the code and it doesn't seem like it. Also, I'm pretty familiar with redis, and it doesn't seem like there's a good way to measure space used by a set of key/values.

The way I dealt with this is to use the redis config file to set max redis size and to set the flag to throw away the oldest values first when it runs out.

Owner

jodosha commented Jan 18, 2013

This is hard to control from a Redis client.

jodosha closed this Jan 18, 2013

@jodosha Yeah, exactly. Like I said, the way I solved it was to use redis's own config file. So as far as I know, this isn't configurable from the client.

@jackquack what configuration changes did you end up making?

girishhh commented Feb 5, 2016

can any one tell me what is max storage limit of redis cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment