Hi~ I had a problam, Ruby on Rails Cache in ApplicationController. The data can't get,but it's exist.
class ApplicationController < ActionController::Base
before_filter :init
def init
@setting = Rails.cache.read("data/setting")
if not @setting
@setting = Setting.find_create
Rails.cache.write("data/setting",@setting)
end
end
end
Development.log show this:
Cache read: data/setting
Setting Load (0.5ms) SELECT * FROM > "settings" LIMIT 1
Cache write: data/setting
Why?