Ticket #14103: cache_honor_use_etags.diff
File cache_honor_use_etags.diff, 1.1 KB (added by , 14 years ago) |
---|
-
django/conf/global_settings.py
430 430 CACHE_BACKEND = 'locmem://' 431 431 CACHE_MIDDLEWARE_KEY_PREFIX = '' 432 432 CACHE_MIDDLEWARE_SECONDS = 600 433 CACHE_MIDDLEWARE_USE_ETAGS = None 433 434 434 435 #################### 435 436 # COMMENTS # -
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.CACHE_MIDDLEWARE_USE_ETAGS==None and settings.USE_ETAGS or \ 105 settings.CACHE_MIDDLEWARE_USE_ETAGS) and not response.has_header('ETag'): 105 106 response['ETag'] = '"%s"' % md5_constructor(response.content).hexdigest() 106 107 if not response.has_header('Last-Modified'): 107 108 response['Last-Modified'] = http_date()