|
@@ -15,21 +15,17 @@ or you can rely on the :class:`~django.middleware.http.ConditionalGetMiddleware`
|
|
|
middleware to set the ``ETag`` header.
|
|
|
|
|
|
When the client next requests the same resource, it might send along a header
|
|
|
-such as either `If-modified-since`_ or `If-unmodified-since`_, containing the
|
|
|
-date of the last modification time it was sent, or either `If-match`_ or
|
|
|
-`If-none-match`_, containing the last ``ETag`` it was sent.
|
|
|
-If the current version of the page matches the ``ETag`` sent by the client, or
|
|
|
-if the resource has not been modified, a 304 status code can be sent back,
|
|
|
-instead of a full response, telling the client that nothing has changed.
|
|
|
+such as either :rfc:`If-modified-since <7232#section-3.3>` or
|
|
|
+:rfc:`If-unmodified-since <7232#section-3.4>`, containing the date of the last
|
|
|
+modification time it was sent, or either :rfc:`If-match <7232#section-3.1>` or
|
|
|
+:rfc:`If-none-match <7232#section-3.2>`, containing the last ``ETag`` it was
|
|
|
+sent. If the current version of the page matches the ``ETag`` sent by the
|
|
|
+client, or if the resource has not been modified, a 304 status code can be sent
|
|
|
+back, instead of a full response, telling the client that nothing has changed.
|
|
|
Depending on the header, if the page has been modified or does not match the
|
|
|
``ETag`` sent by the client, a 412 status code (Precondition Failed) may be
|
|
|
returned.
|
|
|
|
|
|
-.. _If-match: https://tools.ietf.org/html/rfc7232#section-3.1
|
|
|
-.. _If-none-match: https://tools.ietf.org/html/rfc7232#section-3.2
|
|
|
-.. _If-modified-since: https://tools.ietf.org/html/rfc7232#section-3.3
|
|
|
-.. _If-unmodified-since: https://tools.ietf.org/html/rfc7232#section-3.4
|
|
|
-
|
|
|
When you need more fine-grained control you may use per-view conditional
|
|
|
processing functions.
|
|
|
|