Fixed a typo and added a bit more ReST markup to cache middleware docstring.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
3bb50169d9
commit
c0d862d638
|
@ -1,6 +1,6 @@
|
|||
"""
|
||||
Cache middleware. If enabled, each Django-powered page will be cached based on
|
||||
URL. The cannonical way to enable cache middleware is to set
|
||||
URL. The canonical way to enable cache middleware is to set
|
||||
``UpdateCacheMiddleware`` as your first piece of middleware, and
|
||||
``FetchFromCacheMiddleware`` as the last::
|
||||
|
||||
|
@ -15,10 +15,11 @@ last during the response phase, which processes middleware bottom-up;
|
|||
``FetchFromCacheMiddleware`` needs to run last during the request phase, which
|
||||
processes middleware top-down.
|
||||
|
||||
The single-class ``CacheMiddleware`` can be used for some simple sites. However,
|
||||
if any other peice of middleware needs to affect the cache key, you'll need to
|
||||
use the two-part UpdateCacheMiddleware and FetchFromCacheMiddleware. This'll
|
||||
most often happen when you're using Django's LocaleMiddleware.
|
||||
The single-class ``CacheMiddleware`` can be used for some simple sites.
|
||||
However, if any other piece of middleware needs to affect the cache key, you'll
|
||||
need to use the two-part ``UpdateCacheMiddleware`` and
|
||||
``FetchFromCacheMiddleware``. This'll most often happen when you're using
|
||||
Django's ``LocaleMiddleware``.
|
||||
|
||||
More details about how the caching works:
|
||||
|
||||
|
@ -152,4 +153,3 @@ class CacheMiddleware(UpdateCacheMiddleware, FetchFromCacheMiddleware):
|
|||
self.cache_anonymous_only = getattr(settings, 'CACHE_MIDDLEWARE_ANONYMOUS_ONLY', False)
|
||||
else:
|
||||
self.cache_anonymous_only = cache_anonymous_only
|
||||
|
||||
|
|
Loading…
Reference in New Issue