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:
Gary Wilson Jr 2008-08-15 17:47:03 +00:00
parent 3bb50169d9
commit c0d862d638
1 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
""" """
Cache middleware. If enabled, each Django-powered page will be cached based on 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 ``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last:: ``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 ``FetchFromCacheMiddleware`` needs to run last during the request phase, which
processes middleware top-down. processes middleware top-down.
The single-class ``CacheMiddleware`` can be used for some simple sites. However, The single-class ``CacheMiddleware`` can be used for some simple sites.
if any other peice of middleware needs to affect the cache key, you'll need to However, if any other piece of middleware needs to affect the cache key, you'll
use the two-part UpdateCacheMiddleware and FetchFromCacheMiddleware. This'll need to use the two-part ``UpdateCacheMiddleware`` and
most often happen when you're using Django's LocaleMiddleware. ``FetchFromCacheMiddleware``. This'll most often happen when you're using
Django's ``LocaleMiddleware``.
More details about how the caching works: 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) self.cache_anonymous_only = getattr(settings, 'CACHE_MIDDLEWARE_ANONYMOUS_ONLY', False)
else: else:
self.cache_anonymous_only = cache_anonymous_only self.cache_anonymous_only = cache_anonymous_only