summaryrefslogtreecommitdiff
path: root/django/utils/cache.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-10-20 17:40:14 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-10-20 20:05:11 +0200
commit4b27813198ae31892f1159d437e492f7745761a0 (patch)
tree99796c5b894375ac405b5205d4d675caac258136 /django/utils/cache.py
parent300d052713a4312bcfca334ea34b348d57549950 (diff)
downloaddjango-4b27813198ae31892f1159d437e492f7745761a0.tar.gz
Fixed #7581 -- Added streaming responses.
Thanks mrmachine and everyone else involved on this long-standing ticket.
Diffstat (limited to 'django/utils/cache.py')
-rw-r--r--django/utils/cache.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py
index 91c4796988..0fceaa96e6 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -95,7 +95,8 @@ def get_max_age(response):
pass
def _set_response_etag(response):
- response['ETag'] = '"%s"' % hashlib.md5(response.content).hexdigest()
+ if not response.streaming:
+ response['ETag'] = '"%s"' % hashlib.md5(response.content).hexdigest()
return response
def patch_response_headers(response, cache_timeout=None):