title: Rails Redis setting maxmemory and maxmemory-policy
body: <p>I'm trying to set <code>maxmemory</code> and <code>maxmemory-policy</code> in my cache_store configuration of my Rails app.</p>
  
  <p>I did the following in my production.rb file:</p>
  
  <pre><code>  redis_url = "redis://localhost:6379/0"
    config.cache_store = :redis_store, redis_url, { :expires_in =&gt; 4.weeks ,
                                                    :namespace =&gt; 'rails-cache',
                                                    :maxmemory =&gt; '25gb',
                                                    'maxmemory-policy' =&gt; 'volatile-ttl'}
  </code></pre>
  
  <p>But the maxmemory doesn't seam to be working. When I do <code>Rails.cache.methods</code> I don't get any methods about <code>memory</code> or <code>max</code>.</p>
  
  <p>I dont' see any examples on the web for Rails, the closest thing was <a href="https://stackoverflow.com/questions/9471684/handling-redis-maxmemory-situations-with-rails-when-using-rails-caching">handling redis maxmemory situations with rails when using rails caching</a> but it doesn't give any examples.</p>
  
  <p>I also cloned and grepped for <code>maxmemory</code> in the the <code>redis-rb</code> gem (<a href="https://github.com/redis/redis-rb" rel="nofollow noreferrer">https://github.com/redis/redis-rb</a>), but nothing comes up. So it seem like it has not been implemented.</p>