Fixed #33338 -- Doc'd that never_cache() decorator set Expires header.
This commit is contained in:
parent
e61abab6e0
commit
669dcefc04
1
AUTHORS
1
AUTHORS
|
@ -592,6 +592,7 @@ answer newbie questions, and generally made Django that much better:
|
||||||
Marc Aymerich Gubern
|
Marc Aymerich Gubern
|
||||||
Marc Egli <frog32@me.com>
|
Marc Egli <frog32@me.com>
|
||||||
Marcel Telka <marcel@telka.sk>
|
Marcel Telka <marcel@telka.sk>
|
||||||
|
Marcelo Galigniana <marcelogaligniana@gmail.com>
|
||||||
Marc Fargas <telenieko@telenieko.com>
|
Marc Fargas <telenieko@telenieko.com>
|
||||||
Marc Garcia <marc.garcia@accopensys.com>
|
Marc Garcia <marc.garcia@accopensys.com>
|
||||||
Marcin Wróbel
|
Marcin Wróbel
|
||||||
|
|
|
@ -62,10 +62,14 @@ need to distinguish caches by the ``Accept-language`` header.
|
||||||
|
|
||||||
.. function:: add_never_cache_headers(response)
|
.. 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,
|
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
|
private`` header to a response to indicate that a page should never be
|
||||||
cached.
|
cached.
|
||||||
|
|
||||||
|
Each header is only added if it isn't already set.
|
||||||
|
|
||||||
.. function:: patch_vary_headers(response, newheaders)
|
.. function:: patch_vary_headers(response, newheaders)
|
||||||
|
|
||||||
Adds (or updates) the ``Vary`` header in the given ``HttpResponse`` object.
|
Adds (or updates) the ``Vary`` header in the given ``HttpResponse`` object.
|
||||||
|
|
|
@ -118,10 +118,14 @@ client-side caching.
|
||||||
|
|
||||||
.. function:: never_cache(view_func)
|
.. function:: never_cache(view_func)
|
||||||
|
|
||||||
|
This decorator adds an ``Expires`` header to the current date/time.
|
||||||
|
|
||||||
This decorator adds a ``Cache-Control: max-age=0, no-cache, no-store,
|
This decorator adds a ``Cache-Control: max-age=0, no-cache, no-store,
|
||||||
must-revalidate, private`` header to a response to indicate that a page
|
must-revalidate, private`` header to a response to indicate that a page
|
||||||
should never be cached.
|
should never be cached.
|
||||||
|
|
||||||
|
Each header is only added if it isn't already set.
|
||||||
|
|
||||||
.. module:: django.views.decorators.common
|
.. module:: django.views.decorators.common
|
||||||
|
|
||||||
Common
|
Common
|
||||||
|
|
Loading…
Reference in New Issue