Rails Cache Will Not Expire

I am on Heroku and trying to implement caching in my Rails application, but I am having problems that I don’t understand. I thought it would be easy to read the Rails Guide and Heroku docs on caching strategies, but apparently something is wrong.

Problem 1: the type of action does not expire Problem 2: when I use: layout => false, both my admin and application layout are used (trying to get only the application layout)

Any help for this newbie would be greatly appreciated!

production.rb (dalli per heroku documentation is also installed)

config.cache_store = :dalli_store config.action_controller.perform_caching = true (added after reading http://bit.ly/oRKub1) 

controller

 layout 'admin' caches_action :show, :layout => false def show render :layout => 'application' end def update expire_action :action => :show end 

I tried to test the expiration by changing the product, but the presentation does not expire. Therefore, when I look at the view view for products that I don’t cache, I see that the change is saved (just a word is added to the title), but when I view the show, it still has old information.

+7
source share
3 answers

If you use the aspen / bamboo stack, I don’t think caching works on rails as applications go to varnish, which does caching for you

0
source

I don't know about "caches_action", but you can try to finish the entire cache manually and see what happens.

 def update # expire_action :action => :show Rails.cache.clear end 
0
source

If there is a problem with caching, than this link will help you find a solution. You can connect directly to the dalli/memcached client through the heroku console, and then use flush_all to clear the cache.

Or send google-groups link

0
source

All Articles