Ticket #2541: django-middleware-cache.diff
File django-middleware-cache.diff, 804 bytes (added by , 18 years ago) |
---|
-
django/middleware/cache.py
41 41 42 42 def process_request(self, request): 43 43 "Checks whether the page is already cached and returns the cached version if available." 44 if self.cache_anonymous_only: 45 assert hasattr(request, 'user'), "The Django cache middleware requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware'." 46 44 47 if not request.method in ('GET', 'HEAD') or request.GET: 45 48 request._cache_update_cache = False 46 49 return None # Don't bother checking the cache.