Skip to main content

get_max_age

Return the max-age from the response Cache-Control header as an integer, or None if it wasn't found or wasn't an integer.

def get_max_age(
response: HttpResponse
) - > int | None

Return the max-age from the response Cache-Control header as an integer, or None if it wasn't found or wasn't an integer.

Parameters

NameTypeDescription
responseHttpResponseThe response object containing headers to be parsed for cache directives

Returns

TypeDescription
`intNone`