class Protocol::HTTP::Header::CacheControl

def << value

def << value
	super(value.downcase)
end

def dynamic?

def dynamic?
	self.include?(DYNAMIC)
end

def find_integer_value(value_name)

def find_integer_value(value_name)
	if value = self.find{|value| value.start_with?(value_name)}
		_, age = value.split("=", 2)
		
		if age =~ /\A[0-9]+\z/
			return Integer(age)
		end
	end
end

def initialize(value = nil)

def initialize(value = nil)
	super(value&.downcase)
end

def max_age

See https://www.rfc-editor.org/rfc/rfc9111.html#name-max-age-2
The maximum time, in seconds, a response should be considered fresh.
def max_age
	find_integer_value(MAX_AGE)
end

def must_revalidate?

See https://www.rfc-editor.org/rfc/rfc9111.html#name-must-revalidate
Indicates that a response must not be used once it is stale.
def must_revalidate?
	self.include?(MUST_REVALIDATE)
end

def no_cache?

def no_cache?
	self.include?(NO_CACHE)
end

def no_store?

def no_store?
	self.include?(NO_STORE)
end

def private?

def private?
	self.include?(PRIVATE)
end

def proxy_revalidate?

See https://www.rfc-editor.org/rfc/rfc9111.html#name-proxy-revalidate
Like must-revalidate, but for shared caches only.
def proxy_revalidate?
	self.include?(PROXY_REVALIDATE)
end

def public?

def public?
	self.include?(PUBLIC)
end

def s_maxage

See https://www.rfc-editor.org/rfc/rfc9111.html#name-s-maxage
max-age when present.
Like max-age, but for shared caches only, which should use it before
def s_maxage
	find_integer_value(S_MAXAGE)
end

def static?

def static?
	self.include?(STATIC)
end

def streaming?

def streaming?
	self.include?(STREAMING)
end