Jon*_*han 5 memcached ruby-on-rails heroku
考虑以下.从我的heroku控制台:
>> Rails.cache.stats
=> {"server_id"=>{"evictions"=>"0", "curr_items"=>"2064", "total_items"=>"18793", "bytes"=>"7674501", ...
>> Rails.cache.clear
=> [true]
>> Rails.cache.stats
=> {"server_id"=>{"evictions"=>"0", "curr_items"=>"2064", "total_items"=>"18793", "bytes"=>"7674501",
Run Code Online (Sandbox Code Playgroud)
超级怪异 - 如何清除我的缓存!!
小智 3
如果您通过控制台直接连接到 Dalli/memcahced 客户端并刷新所有,缓存将被清除。
IE
dc = Dalli::Client.new('localhost:11211')
dc.flush_all
Run Code Online (Sandbox Code Playgroud)
注意:统计数据需要一段时间才能更新,但缓存肯定会清除。