Class: Faraday::HttpCache::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/http_cache/response.rb

Overview

Internal: a class to represent a response from a Faraday request. It decorates the response hash into a smarter object that queries the response headers and status informations about how the caching middleware should handle this specific response.

Instance Method Summary collapse

Instance Method Details

#cacheable?(unused_argument) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'lib/http_cache/response.rb', line 8

def cacheable?(unused_argument)
  return false if cache_control.no_store?

  cacheable_status_code? && (validateable? || fresh?)
end