Basic caching for ActiveRecord models using the Rails low-level cache (Rails.cache
).
In your Gemfile, add this line:
gem "activerecord_cache"
To enable caching for a model:
class User < ActiveRecord::Baes
self.use_activerecord_cache = true
end
Or:
User.use_activerecord_cache = true