Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 Rails.cache.fetch(method_name, :expires_in => 15.minutes) 来缓存数据。当我更新列时,更新的列仅在 15 分钟后显示在页面中。有没有办法只清除更新记录的缓存?
您可以使用清除整个缓存Rails.cache.clear。
Rails.cache.clear
要清除单个条目,请使用Rails.cache.delete(method_name)。
Rails.cache.delete(method_name)