Weird cacheing issues with heroku / memcache and dalli

社会主义新天地 提交于 2019-12-05 09:39:32

If you connect directly to the Dalli/memcahced client through the console and flush_all the cache clears.

i.e.

dc = Dalli::Client.new('localhost:11211')
dc.flush_all

NOTE: the stats take a while to update, but the cache will definitely clear.

The Expiring Cache section at http://devcenter.heroku.com/articles/building-a-rails-3-application-with-the-memcache-addon suggests using filters

after_save    :expire_contact_all_cache
after_destroy :expire_contact_all_cache

def expire_contact_all_cache
  Rails.cache.delete('Contact.all')
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!