Module: RocketPants::Caching::ClassMethods
- Defined in:
- lib/rocket_pants/controller/caching.rb
Instance Method Summary collapse
-
#caches(*args) ⇒ Object
Sets up automatic etag and cache control headers for api resource controllers using an after filter.
Instance Method Details
#caches(*args) ⇒ Object
Sets up automatic etag and cache control headers for api resource controllers using an after filter. Note that for the middleware to actually be inserted, ‘RocketPants.enable_caching` needs to be set to true.
94 95 96 97 98 99 100 101 102 103 |
# File 'lib/rocket_pants/controller/caching.rb', line 94 def caches(*args) = args. self.cached_actions += Array.wrap(args).map(&:to_s).compact # Setup the time based caching. if .has_key?(:cache_for) self.caching_timeout = .delete(:cache_for) end # Merge in any caching options for other controllers. .merge!(.delete(:caching_options) || {}) end |