Module: Simple::HTTP::Caching
Overview
This file is part of the simple-http ruby gem.
Copyright © 2011 - 2015 @radiospiel Distributed under the terms of the modified BSD license, see LICENSE.BSD
Instance Method Summary collapse
-
#determine_expires_in(response) ⇒ Object
returns expiration information, in seconds from now.
Instance Method Details
#determine_expires_in(response) ⇒ Object
returns expiration information, in seconds from now.
11 12 13 14 15 16 17 18 |
# File 'lib/simple/http/caching.rb', line 11 def determine_expires_in(response) return nil unless cacheable_status?(response.status) expires_in = parse_cache_control response expires_in ||= parse_expires response return expires_in if expires_in && expires_in > 0 end |