Fixed #22827 -- clarified what each cache middleware does.

Thanks Keryn Knight for the report.
This commit is contained in:
Moayad Mardini 2014-07-25 11:42:06 +03:00 committed by Tim Graham
parent aa8bc7fa7d
commit f9b7a0383c
1 changed files with 7 additions and 7 deletions

View File

@ -465,14 +465,14 @@ Then, add the following required settings to your Django settings file:
the site, or some other string that is unique to this Django instance, to the site, or some other string that is unique to this Django instance, to
prevent key collisions. Use an empty string if you don't care. prevent key collisions. Use an empty string if you don't care.
The cache middleware caches GET and HEAD responses with status 200, where the request ``FetchFromCacheMiddleware`` caches GET and HEAD responses with status 200,
and response headers allow. Responses to requests for the same URL with different where the request and response headers allow. Responses to requests for the same
query parameters are considered to be unique pages and are cached separately. URL with different query parameters are considered to be unique pages and are
The cache middleware expects that a HEAD request is answered with the same cached separately. This middleware expects that a HEAD request is answered with
response headers as the corresponding GET request; in which case it can return the same response headers as the corresponding GET request; in which case it can
a cached GET response for HEAD request. return a cached GET response for HEAD request.
Additionally, the cache middleware automatically sets a few headers in each Additionally, ``UpdateCacheMiddleware`` automatically sets a few headers in each
:class:`~django.http.HttpResponse`: :class:`~django.http.HttpResponse`:
* Sets the ``Last-Modified`` header to the current date/time when a fresh * Sets the ``Last-Modified`` header to the current date/time when a fresh