From cb17f7ca2252265ab4a844e7924cb8ebab4a1a76 Mon Sep 17 00:00:00 2001 From: Honza Král Date: Fri, 29 Oct 2010 01:31:15 +0000 Subject: 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 --- docs/topics/cache.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 5797199411..f2b7a594d3 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -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``: -- cgit v1.3