Method: Kiosk::Cacheable::Resource::ClassMethods#cached_expire_in
- Defined in:
- lib/kiosk/cacheable/resource.rb
#cached_expire_in(expiry = nil, &blk) ⇒ Object
Specifies the length of time for which a resource should stay cached. Either a Fixnum (time in seconds) or block can be given. The block should accept the resource as its argument and should return the expiry time for the resource in seconds.
Keep in mind that the underlying cache store may not support expiration length. In that case, this option has no effect.
39 40 41 |
# File 'lib/kiosk/cacheable/resource.rb', line 39 def cached_expire_in(expiry = nil, &blk) connection.cache_expiry = expiry || blk end |