mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #26447 -- Deprecated settings.USE_ETAGS in favor of ConditionalGetMiddleware.
This commit is contained in:
parent
46a3d7604e
commit
a840710e1e
15 changed files with 126 additions and 24 deletions
|
@ -72,6 +72,12 @@ Adds a few conveniences for perfectionists:
|
|||
|
||||
Older versions didn't set the ``Content-Length`` header.
|
||||
|
||||
.. deprecated:: 1.11
|
||||
|
||||
The :setting:`USE_ETAGS` setting is deprecated in favor of using
|
||||
:class:`~django.middleware.http.ConditionalGetMiddleware` for ETag
|
||||
processing.
|
||||
|
||||
.. attribute:: CommonMiddleware.response_redirect_class
|
||||
|
||||
Defaults to :class:`~django.http.HttpResponsePermanentRedirect`. Subclass
|
||||
|
@ -166,13 +172,18 @@ Conditional GET middleware
|
|||
|
||||
.. class:: ConditionalGetMiddleware
|
||||
|
||||
Handles conditional GET operations. If the response has a ``ETag`` or
|
||||
Handles conditional GET operations. If the response doesn't have an ``ETag``
|
||||
header, the middleware adds one if needed. If the response has a ``ETag`` or
|
||||
``Last-Modified`` header, and the request has ``If-None-Match`` or
|
||||
``If-Modified-Since``, the response is replaced by an
|
||||
:class:`~django.http.HttpResponseNotModified`.
|
||||
|
||||
Also sets the ``Date`` and ``Content-Length`` response-headers.
|
||||
|
||||
.. versionchanged:: 1.11
|
||||
|
||||
In older versions, the middleware didn't set the ``ETag`` header.
|
||||
|
||||
Locale middleware
|
||||
-----------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue