INNER CODE UNIT · Python
_is_not_modified
redis/fastapi-redis-sdk · src/redis_fastapi/cache.py:439
def _is_not_modified(
request: Request, etag: str, stored: list[tuple[str, str]]
) -> bool:
"""Whether this conditional request can be answered with a ``304``.
``If-None-Match`` decides on its own when present: RFC 9110
section 13.2.2 requires a recipient to ignore ``If-Modified-Since`` when
the request carries an entity-tag precondition. ``If-Modified-Since`` is
evaluated only against a ``Last-Modified`` the entry actually stored.
Args:
request: The incoming request.
etag: The entry's stored validator.
stored: The entry's stored header pairs.
Returns:
``True`` when the client's copy is still current.
"""