              # max-age was set to 0, don't bother caching.
              return response
          patch_response_headers(response, timeout)
          if timeout:
              cache_key = learn_cache_key(request, response, timeout, self.key_prefix)
              self.cache.set(cache_key, response, timeout)
          return response
  
  class FetchFromCacheMiddleware(object):
      """
 
</s> remove def learn_cache_key(request, response, cache_timeout=None, key_prefix=None):
 </s> add def learn_cache_key(request, response, cache_timeout=None, key_prefix=None, cache=None): </s> remove             cache_key = get_cache_key(request, self.key_prefix, 'HEAD')
 </s> add             cache_key = get_cache_key(request, self.key_prefix, 'HEAD', cache=self.cache) </s> remove         cache_key = get_cache_key(request, self.key_prefix, 'GET')

 </s> add         cache_key = get_cache_key(request, self.key_prefix, 'GET', cache=self.cache)
            cache_key = learn_cache_key(request, response, timeout, self.key_prefix, cache=self.cache)
              # max-age was set to 0, don't bother caching.
              return response
          patch_response_headers(response, timeout)
          if timeout:
            cache_key = learn_cache_key(request, response, timeout, self.key_prefix, cache=self.cache)
              self.cache.set(cache_key, response, timeout)
          return response
  
  class FetchFromCacheMiddleware(object):
      """
keep keep keep keep replace keep keep keep keep keep
 Beefed up the tests for multi-cache handling of the cache middleware and view decorators, and made a couple of tweaks for edge cases as a result.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15021 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/middleware/cache.py