Refs #31949 -- Made @vary_on_(cookie/headers) decorators work with async functions.

This commit is contained in:
Ben Lomax 2023-07-08 21:54:37 +01:00 committed by Mariusz Felisiak
parent fb1c763506
commit b7a17b0ea0
5 changed files with 97 additions and 6 deletions

View file

@ -94,6 +94,8 @@ view functions:
* :func:`~django.views.decorators.http.require_GET`
* :func:`~django.views.decorators.http.require_POST`
* :func:`~django.views.decorators.http.require_safe`
* :func:`~django.views.decorators.vary.vary_on_cookie`
* :func:`~django.views.decorators.vary.vary_on_headers`
* ``xframe_options_deny()``
* ``xframe_options_sameorigin()``
* ``xframe_options_exempt()``

View file

@ -115,6 +115,10 @@ caching based on specific request headers.
.. function:: vary_on_cookie(func)
.. versionchanged:: 5.0
Support for wrapping asynchronous view functions was added.
.. function:: vary_on_headers(*headers)
The ``Vary`` header defines which request headers a cache mechanism should take
@ -122,6 +126,10 @@ caching based on specific request headers.
See :ref:`using vary headers <using-vary-headers>`.
.. versionchanged:: 5.0
Support for wrapping asynchronous view functions was added.
.. module:: django.views.decorators.cache
Caching