mirror of
https://github.com/django/django.git
synced 2025-11-20 11:36:04 +00:00
add documentation
This commit is contained in:
parent
b530fd299c
commit
dc07fac1a7
1 changed files with 17 additions and 0 deletions
|
|
@ -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``
|
||||
==========================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue