Module: HalApi::Controller::Cache::ClassMethods
- Defined in:
- lib/hal_api/controller/cache.rb
Instance Method Summary collapse
Instance Method Details
#cache_api_action(action, options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/hal_api/controller/cache.rb', line 31 def cache_api_action(action, = {}) = .merge( || {}) cache_path_method = .delete(:cache_path_method) cache_path_method ||= "#{action}_cache_path" unless [:cache_path] [:cache_path] = lambda do |c| c.send(:valid_params_for_action, action).merge _c: send(cache_path_method) end end caches_action(action, ) end |
#cache_options ⇒ Object
43 44 45 |
# File 'lib/hal_api/controller/cache.rb', line 43 def { compress: true, expires_in: 1.hour, race_condition_ttl: 30 } end |