Question

development.rb cache configuration

  config.action_controller.perform_caching = true
  config.cache_store = :dalli_store, 'localhost:11211',
    { :namespace => APP_NAME, :expires_in => 3.month, :compress => true }

production.rb cache configuration

   config.action_controller.perform_caching = true
   config.cache_store = :dalli_store, 'localhost:11211',
     { :namespace => APP_NAME, :expires_in => 3.month, :compress => true }

in console

rails c production
Loading production environment (Rails 3.2.3)
1.9.3-p125 :001 > Rails.cache.write 'res', "Hello World"
 => true 
1.9.3-p125 :002 >  Rails.cache.read 'res'
 => nil 
1.9.3-p125 :003 > 

Why?

Was it helpful?

Solution

memcached has a limit of 30 days if you defined the expiry that way - Memcache maximum key expiration time

Also see https://github.com/mperham/dalli/issues/55

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top