INNER CODE UNIT · Python
_storage_refusal
redis/fastapi-redis-sdk · src/redis_fastapi/cache.py:536
def _storage_refusal(
request: Request,
pending: CachePending,
response_status: int,
response_headers: list[tuple[bytes, bytes]],
) -> str | None:
"""Return why this response must not be stored, or ``None`` to store it.
Every branch is a rule from RFC 9111 or a limit of the entry format, and
"Cache scope" in the architecture guide documents them one for one, so a
refusal in the log can be looked up.
Args:
request: The request being served.
pending: The pending cache operation, which says whether this is a
read-path fill or a write-through.
response_status: Status code from ``http.response.start``.
response_headers: Raw ASGI response headers.