Ticket #16003: 16003.patch
File 16003.patch, 873 bytes (added by , 13 years ago) |
---|
-
django/utils/cache.py
102 102 if cache_timeout < 0: 103 103 cache_timeout = 0 # Can't have max-age negative 104 104 if settings.USE_ETAGS and not response.has_header('ETag'): 105 response['ETag'] = '"%s"' % hashlib.md5(response.content).hexdigest() 105 from django.template.response import SimpleTemplateResponse 106 if isinstance(response, SimpleTemplateResponse): 107 content = response.rendered_content 108 else: 109 content = response.content 110 response['ETag'] = '"%s"' % hashlib.md5(content).hexdigest() 106 111 if not response.has_header('Last-Modified'): 107 112 response['Last-Modified'] = http_date() 108 113 if not response.has_header('Expires'):