ruby-on-rails - heroku/memcache 和 dalli 的奇怪缓存问题

标签 ruby-on-rails heroku memcached

考虑以下。从我的 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",

super 奇怪——我怎么能清除我的缓存!!

类似问题? :https://stackoverflow.com/q/7122513/192791

最佳答案

如果您通过控制台和flush_all 直接连接到Dalli/memcahced 客户端,缓存会清除。

IE。

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

注意:统计数据需要一段时间才能更新,但缓存肯定会清除。

关于ruby-on-rails - heroku/memcache 和 dalli 的奇怪缓存问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7122962/

相关文章:

java - 谷歌应用引擎 : Memcache or Static variable?

Python 内存缓存 : caching objects

heroku - Heroku dynos 一天中的什么时间重新启动?

ruby-on-rails - Rails4 和 Devise(NoMethod 错误)

ruby-on-rails - 在 Ruby 中使用 HMAC SHA256

ruby-on-rails - ActiveRecord:查询未对 STI 子类使用正确的类型条件

python - 使用 Django/Python 在 Heroku 上自定义字体

django - 无法使用 boto 通过 Heroku 将静态收集到 s3 - s3 存储桶返回 NoneType

django - 如何同时使用 Django、sorl-thumbnail、memcached 和 S3?

ruby-on-rails - 如何在 Devise 上重定向 'Confirmation token invalid'