Code

Ticket #4943: 4943.patch

File 4943.patch, 1.1 KB (added by SmileyChris, 7 years ago)
  • docs/cache.txt

     
    228228        'django.middleware.common.CommonMiddleware', 
    229229    ) 
    230230 
    231 (The order of ``MIDDLEWARE_CLASSES`` matters. See "Order of MIDDLEWARE_CLASSES" 
     231(The order of ``MIDDLEWARE_CLASSES`` matters. See `Order of MIDDLEWARE_CLASSES`_ 
    232232below.) 
    233233 
    234234Then, add the following required settings to your Django settings file: 
     
    556556to know which headers by which to vary the cache storage. Middleware always 
    557557adds something to the ``Vary`` response header when it can. 
    558558 
    559 Put the ``CacheMiddleware`` after any middlewares that might add something to 
    560 the ``Vary`` header. The following middlewares do so: 
     559Put the ``CacheMiddleware`` *before* any other middleware that might add 
     560something to the ``Vary`` header (response middleware is applied in reverse 
     561order). The following middleware modules do so: 
    561562 
    562563    * ``SessionMiddleware`` adds ``Cookie`` 
    563564    * ``GZipMiddleware`` adds ``Accept-Encoding`` 
     565    * ``LocaleMiddleware`` adds ``Accept-Language``