Ticket #14103: django_utils_cache_honor_use_etags.diff

File django_utils_cache_honor_use_etags.diff, 631 bytes (added by trbs, 14 years ago)
  • django/utils/cache.py

     
    101101        cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS
    102102    if cache_timeout < 0:
    103103        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'):
    105105        response['ETag'] = '"%s"' % md5_constructor(response.content).hexdigest()
    106106    if not response.has_header('Last-Modified'):
    107107        response['Last-Modified'] = http_date()
Back to Top