mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #14560 -- Enable HEAD requests to be cached properly. Thanks, codemonkey!
Introducing ability to cache HEAD requests and GET requests separately by adding the method to the cache key while preserving the functionality that HEAD requests can use cached reponses generated by a GET request. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -328,7 +328,9 @@ parameters. Optionally, if the ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting is
|
||||
will be cached. This is a simple and effective way of disabling caching for any
|
||||
user-specific pages (include Django's admin interface). Note that if you use
|
||||
``CACHE_MIDDLEWARE_ANONYMOUS_ONLY``, you should make sure you've activated
|
||||
``AuthenticationMiddleware``.
|
||||
``AuthenticationMiddleware``. The cache middleware expects that a HEAD request
|
||||
is answered with the same response headers exactly like the corresponding GET
|
||||
request, in that case it could return cached GET response for HEAD request.
|
||||
|
||||
Additionally, the cache middleware automatically sets a few headers in each
|
||||
``HttpResponse``:
|
||||
|
||||
Reference in New Issue
Block a user