add documentation

This commit is contained in:
Ramiro Juan Nocelli 2025-10-14 21:00:45 +02:00
parent b530fd299c
commit dc07fac1a7

View file

@ -103,6 +103,23 @@ need to distinguish caches by the ``Accept-language`` header.
cache, this means that we have to build the response once to get at the
Vary header and so at the list of headers to use for the cache key.
.. function:: invalidate_view_cache(path=None, request=None, key_prefix=None, cache=None):
Delete a view cache key based on either a relative URL (``path``)
or a request object (``request``).
The cache key is reconstructed in two steps:
1. A headers cache key is built using the absolute URL,
key prefix, and locale code.
2. A response cache key is then built using the absolute URL,
key prefix, HTTP method, and recovered headers.
The ``key_prefix`` must match the value used in the ``cache_page``
decorator for the corresponding view.
Either the ``path`` or ``request`` parameter must be provided.
If both are given, ``path`` takes precedence.
``django.utils.dateparse``
==========================