caching - Why the Rails.cache.read can't get anything in ApplicationController? -
I had a problam, RailCache cache could not receive ApplicationController data, but it exists.
class ApplicationController & lt; ActionController :: Base before_filter: init def init @setting = rails.cache.read ("Data / Settings") If not @setting @setting = setting.find_create Rails.cache.write ("Data / Settings", @setting) end To write the "Settings" range 1 cache from : Data / Settings
Why?
If you are running your app in development mode, then it is possible that caching is on. See your config / development.rb file for the following:
config.action_controller.perform_caching = false To check your caching, you or the value Can change to correct, or run in a different environment where caching is on. I often create an environment development_ass-generation, which points to growth DB, but my production With RB settings
Comments
Post a Comment