Skip to content

Commit d4a2fbb

Browse files
Added note to docs/cache.txt about CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True and ordering AuthenticationMiddleware. Refs django#2541.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3604 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent d592ca4 commit d4a2fbb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/cache.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ The cache middleware caches every page that doesn't have GET or POST
233233
parameters. Optionally, if the ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting is
234234
``True``, only anonymous requests (i.e., not those made by a logged-in user)
235235
will be cached. This is a simple and effective way of disabling caching for any
236-
user-specific pages (include Django's admin interface).
236+
user-specific pages (include Django's admin interface). Note that if you use
237+
``CACHE_MIDDLEWARE_ANONYMOUS_ONLY``, you should make sure you've activated
238+
``AuthenticationMiddleware`` and that ``AuthenticationMiddleware`` appears
239+
before ``CacheMiddleware`` in your ``MIDDLEWARE_CLASSES``.
237240

238241
Additionally, ``CacheMiddleware`` automatically sets a few headers in each
239242
``HttpResponse``:

0 commit comments

Comments
 (0)