Rails 4 low-level caching not working
问题 I think is not working because I test it with a real db situation, and always returns the content of db Execute the Rails.cache.fetch Modify the database Execute again the Rails.cache.fetch , and here It not should return the new value that I've modified in db. but it happens, not caching is executed class Translation < ActiveRecord::Base def self.translate(es_text,locale=I18n.locale) Rails.cache.fetch("#{es_text}/#{locale}", expires_in: 1.month) do trad=self.find_by_es_text(es_text)