class HTTP::Cache::Headers

def explicit_max_age

Returns:
  • (Numeric) - the value of the max-age component of cache control
def explicit_max_age
  get(HTTP::Headers::CACHE_CONTROL).
    map { |v| (/max-age=(\d+)/i).match(v) }.
    compact.
    map { |m| m[1].to_i }.
    max
end