title: Why the Rails.cache.read can't get anything in ApplicationController?
body: <p>I have a problem with my Ruby on rails application. The Ruby on Rails Cache in ApplicationController.
  The data can't get, but it exists.</p>
  <pre><code>class ApplicationController &lt; ActionController::Base
    before_filter :init
  
    def init
      @setting = Rails.cache.read(&quot;data/setting&quot;)
      if not @setting
        @setting = Setting.find_create
        Rails.cache.write(&quot;data/setting&quot;,@setting)
      end
    end
  end
  </code></pre>
  <p>Development.log show this:</p>
  <blockquote>
  <p>Cache read: data/setting</p>
  <p>Setting Load (0.5ms)   SELECT * FROM &gt; &quot;settings&quot; LIMIT 1<br />
  Cache write: data/setting</p>
  </blockquote>
  <p>Why is this happening?</p>