mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
[4.0.x] Fixed #33338 -- Doc'd that never_cache() decorator set Expires header.
Backport of 669dcefc04
from main
This commit is contained in:
parent
c607ee949d
commit
cc5bbd447b
3 changed files with 9 additions and 0 deletions
|
@ -62,10 +62,14 @@ need to distinguish caches by the ``Accept-language`` header.
|
|||
|
||||
.. function:: add_never_cache_headers(response)
|
||||
|
||||
Adds an ``Expires`` header to the current date/time.
|
||||
|
||||
Adds a ``Cache-Control: max-age=0, no-cache, no-store, must-revalidate,
|
||||
private`` header to a response to indicate that a page should never be
|
||||
cached.
|
||||
|
||||
Each header is only added if it isn't already set.
|
||||
|
||||
.. function:: patch_vary_headers(response, newheaders)
|
||||
|
||||
Adds (or updates) the ``Vary`` header in the given ``HttpResponse`` object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue