title: Change Rails cache_store at runtime?
body: <p>My application has a feature that allows the administrator can change the cache_store configuration via a GUI. Then the new configuration will take effect right away.</p>
  
  <p>The default cache_store in my production.rb:</p>
  
  <pre><code>config.cache_store = :memory_store
  </code></pre>
  
  <p>The admin can optionally change to use memcached with Dalli store. I tried to change Rails.application.config.cache_store:</p>
  
  <pre><code>Rails.application.config.cache_store = :dalli_store, 'localhost:11211', 'localhost:11212'
  </code></pre>
  
  <p>But the Rails.cache does not change:</p>
  
  <pre><code>Rails.cache
  =&gt; &lt;#ActiveSupport::Cache::MemoryStore entries=0, size=0, options={}&gt;
  </code></pre>
  
  <p>Is there anyway to do this?</p>