from typing import Any

from django.core.cache.backends.base import BaseCache
from django.http.request import HttpRequest
from django.http.response import HttpResponse, HttpResponseBase

cc_delim_re: Any

def patch_cache_control(response: HttpResponseBase, **kwargs: Any) -> None: ...
def get_max_age(response: HttpResponse) -> int | None: ...
def set_response_etag(response: HttpResponseBase) -> HttpResponseBase: ...
def get_conditional_response(
    request: HttpRequest,
    etag: str | None = ...,
    last_modified: int | None = ...,
    response: HttpResponse | None = ...,
) -> HttpResponse | None: ...
def patch_response_headers(
    response: HttpResponseBase, cache_timeout: float = ...
) -> None: ...
def add_never_cache_headers(response: HttpResponseBase) -> None: ...
def patch_vary_headers(response: HttpResponseBase, newheaders: tuple[str]) -> None: ...
def has_vary_header(response: HttpResponse, header_query: str) -> bool: ...
def get_cache_key(
    request: HttpRequest,
    key_prefix: str | None = ...,
    method: str = ...,
    cache: BaseCache | None = ...,
) -> str | None: ...
def learn_cache_key(
    request: HttpRequest,
    response: HttpResponse,
    cache_timeout: float | None = ...,
    key_prefix: str | None = ...,
    cache: BaseCache | None = ...,
) -> str: ...
