code: def process_request(self, request):
          
          if self.cache_anonymous_only:
              assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware' before the CacheMiddleware."
  
          if not request.method in ('GET', 'HEAD') or request.GET:
              request._cache_update_cache = False
              return None # Don't bother checking the cache.
  
          if self.cache_anonymous_only and request.user.is_authenticated():
              request._cache_update_cache = False
              return None # Don't cache requests from authenticated users.
  
          cache_key = get_cache_key(request, self.key_prefix)
          if cache_key is None:
              request._cache_update_cache = True
              return None # No cache information available, need to rebuild.
  
          response = cache.get(cache_key, None)
          if response is None:
              logging.debug("FetchFromCacheMiddleware: %s is %s.  paramters(%s)" % ( cache_key, request.path, get_cache_key_parameters(request)))
              request._cache_update_cache = True
              return None # No cache information available, need to rebuild.
          logging.debug("Found %s -> %s in the cache. parameters(%s)" % (cache_key, request.path, get_cache_key_parameters(request)))
          request._cache_update_cache = False
          return response
docs: Checks whether the page is already cached and returns the cached
          version if available.