Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rails::Configuration default_cache_store not called

#514

The Rails::Configuration class initialize method does not call the default_cache_store method to assign a default value to the cache_store attribute.

If no cache store is explicitly configured then later, when the global cache is actually initialised (in the initialize_cache method of Rails::Initializer) and because the configuration.cache_store attribute is nil, then the default cache store is always a MemoryStore regardless of whether or not the tmp/cache directory exists.

Reported by Rob Anderton · June 30th, 2008 @ 11:52 AM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Karel Minařík
    Karel Minařík
    • Tag changed from activesupport, bug, railties to 2.1, activesupport, bug, railties

    +1

    I recently run into this issue, because Rails 2.1 kept storing my cache in memory, instead of tmp/cache and I had to debug extensively.

    (I wanted to preserve cache content between deploys on a particular ActiveResource-based application. No need to flush precious cached content because of some minor change in CSS, better done with precision aim of Cap/Rake task).

    August 19th, 2008 @ 10:23 AM

  2. josh
    josh
    • State changed from new to resolved

    Looks like this was added.

    
        def initialize_cache
          unless defined?(RAILS_CACHE)
            silence_warnings { Object.const_set "RAILS_CACHE", ActiveSupport::Cache.lookup_store(configuration.cache_store) }
          end
        end
    

    November 22nd, 2008 @ 06:58 PM