diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-21 12:12:45 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-21 12:12:45 +0000 |
| commit | 4c3586582d37b7badfafab0deb630f114d0dd449 (patch) | |
| tree | 35f3204e32e6801768d78ccfc5cafa9015713292 /docs | |
| parent | df644cbab9d1874903bceb853f08da7a9ec56a7a (diff) | |
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
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cache.txt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/cache.txt b/docs/cache.txt index 6fe0a22ae7..20c59bfe97 100644 --- a/docs/cache.txt +++ b/docs/cache.txt @@ -228,7 +228,7 @@ entire site. Just add ``'django.middleware.cache.CacheMiddleware'`` to your 'django.middleware.common.CommonMiddleware', ) -(The order of ``MIDDLEWARE_CLASSES`` matters. See "Order of MIDDLEWARE_CLASSES" +(The order of ``MIDDLEWARE_CLASSES`` matters. See `Order of MIDDLEWARE_CLASSES`_ below.) 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 ``max_age`` in a ``cache_control`` decorator, the decorator will take precedence, and the header values will be merged correctly.) -If you want to use headers to disable caching altogether, +If you want to use headers to disable caching altogether, ``django.views.decorators.never_cache`` is a view decorator that adds headers to ensure the response won't be cached by browsers or other caches. Example:: @@ -565,8 +565,11 @@ within the ``MIDDLEWARE_CLASSES`` setting, because the cache middleware needs to know which headers by which to vary the cache storage. Middleware always adds something to the ``Vary`` response header when it can. -Put the ``CacheMiddleware`` after any middlewares that might add something to -the ``Vary`` header. The following middlewares do so: +Put the ``CacheMiddleware`` *before* any other middleware that might add +something to the ``Vary`` header (response middleware is applied in reverse +order). The following middleware modules do so: * ``SessionMiddleware`` adds ``Cookie`` * ``GZipMiddleware`` adds ``Accept-Encoding`` + * ``LocaleMiddleware`` adds ``Accept-Language`` + |
