Ticket #6173: cache.patch
File cache.patch, 832 bytes (added by , 17 years ago) |
---|
-
middleware/cache.py
old new class CacheMiddleware(object): 70 70 if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache: 71 71 # We don't need to update the cache, just return. 72 72 return response 73 if request.method != 'GET':74 # This is a stronger requirement than above. It is needed75 # because of interactions between this middleware and the76 # HTTPMiddleware, which throws the body of a HEAD-request77 # away before this middleware gets a chance to cache it.78 return response79 73 if not response.status_code == 200: 80 74 return response 81 75 patch_response_headers(response, self.cache_timeout)