Loading django/middleware/cache.py +10 −10 Original line number Diff line number Diff line """ 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:: Loading @@ -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: Loading Loading @@ -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
django/middleware/cache.py +10 −10 Original line number Diff line number Diff line """ 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:: Loading @@ -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: Loading Loading @@ -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