cache_ttl()
click to toggle source
def cache_ttl
options[:cache_ttl]
end
cacheable?()
click to toggle source
def cacheable?
Typhoeus::Config.cache
end
response=(response)
click to toggle source
def response=(response)
Typhoeus::Config.cache.set(self, response) if cacheable? && !response.cached?
super
end
run()
click to toggle source
def run
if cacheable? && response = Typhoeus::Config.cache.get(self)
response.cached = true
finish(response)
else
super
end
end