Ticket #14103: django_utils_cache_honor_use_etags.diff
File django_utils_cache_honor_use_etags.diff, 631 bytes (added by , 14 years ago) |
---|
-
django/utils/cache.py
101 101 cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS 102 102 if cache_timeout < 0: 103 103 cache_timeout = 0 # Can't have max-age negative 104 if not response.has_header('ETag'):104 if settings.USE_ETAGS and not response.has_header('ETag'): 105 105 response['ETag'] = '"%s"' % md5_constructor(response.content).hexdigest() 106 106 if not response.has_header('Last-Modified'): 107 107 response['Last-Modified'] = http_date()