Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4493 -- Noted that the LocaleMiddleware's placement w.r.t

CacheMiddleware is important. Thanks, SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4c3586582d37b7badfafab0deb630f114d0dd449 1 parent df644cb
Malcolm Tredinnick authored October 21, 2007

Showing 1 changed file with 7 additions and 4 deletions. Show diff stats Hide diff stats

  1. 11  docs/cache.txt
11  docs/cache.txt
@@ -228,7 +228,7 @@ entire site. Just add ``'django.middleware.cache.CacheMiddleware'`` to your
228 228
         'django.middleware.common.CommonMiddleware',
229 229
     )
230 230
 
231  
-(The order of ``MIDDLEWARE_CLASSES`` matters. See "Order of MIDDLEWARE_CLASSES"
  231
+(The order of ``MIDDLEWARE_CLASSES`` matters. See `Order of MIDDLEWARE_CLASSES`_
232 232
 below.)
233 233
 
234 234
 Then, add the following required settings to your Django settings file:
@@ -533,7 +533,7 @@ the value of the ``CACHE_MIDDLEWARE_SETTINGS`` setting. If you use a custom
533 533
 ``max_age`` in a ``cache_control`` decorator, the decorator will take
534 534
 precedence, and the header values will be merged correctly.)
535 535
 
536  
-If you want to use headers to disable caching altogether, 
  536
+If you want to use headers to disable caching altogether,
537 537
 ``django.views.decorators.never_cache`` is a view decorator that adds
538 538
 headers to ensure the response won't be cached by browsers or other caches. Example::
539 539
 
@@ -565,8 +565,11 @@ within the ``MIDDLEWARE_CLASSES`` setting, because the cache middleware needs
565 565
 to know which headers by which to vary the cache storage. Middleware always
566 566
 adds something to the ``Vary`` response header when it can.
567 567
 
568  
-Put the ``CacheMiddleware`` after any middlewares that might add something to
569  
-the ``Vary`` header. The following middlewares do so:
  568
+Put the ``CacheMiddleware`` *before* any other middleware that might add
  569
+something to the ``Vary`` header (response middleware is applied in reverse
  570
+order). The following middleware modules do so:
570 571
 
571 572
     * ``SessionMiddleware`` adds ``Cookie``
572 573
     * ``GZipMiddleware`` adds ``Accept-Encoding``
  574
+    * ``LocaleMiddleware`` adds ``Accept-Language``
  575
+

0 notes on commit 4c35865

Please sign in to comment.
Something went wrong with that request. Please try again.