Django

Code

Show
Ignore:
Timestamp:
09/29/08 22:58:09 (2 months ago)
Author:
mtredinnick
Message:

Fixed #9221 -- Small optimisation to caching middleware handling.

In the slightly unusual case that CACHE_MIDDLEWARE_SECONDS is set to 0, don't
bother storing a copy in the local cache.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/middleware/cache.py

    r8387 r9098  
    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: 
     93            cache_key = learn_cache_key(request, response, timeout, self.key_prefix) 
     94            cache.set(cache_key, response, timeout) 
    9495        return response 
    9596