Ticket #9221: cache_timeout_0_bug.patch

File cache_timeout_0_bug.patch, 715 bytes (added by Wonlay, 16 years ago)
  • django/middleware/cache.py

     
    8989            # max-age was set to 0, don't bother caching.
    9090            return response
    9191        patch_response_headers(response, timeout)
    92         cache_key = learn_cache_key(request, response, timeout, self.key_prefix)
    93         cache.set(cache_key, response, timeout)
     92        if timeout > 0:
     93            cache_key = learn_cache_key(request, response, timeout, self.key_prefix)
     94            cache.set(cache_key, response, timeout)
    9495        return response
    9596
    9697class FetchFromCacheMiddleware(object):
Back to Top