diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-03-17 17:21:26 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-03-17 17:21:26 +0000 |
| commit | 426e7223fb7bf1639a3b331ed3818922fafe820c (patch) | |
| tree | 783dac9f22a6c034eaffb97f2e15ca94e2fc862b | |
| parent | a05e05a7f0e9c9c8f1e82e1a637994f14a1ef3b9 (diff) | |
Changed django.utils.cache.patch_response_headesr to move unnecessary calculation of 'expires' into the 'if' statement
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2528 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/utils/cache.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py index 4c7d0bb840..7c7a41bafa 100644 --- a/django/utils/cache.py +++ b/django/utils/cache.py @@ -73,12 +73,12 @@ def patch_response_headers(response, cache_timeout=None): if cache_timeout is None: cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS now = datetime.datetime.utcnow() - expires = now + datetime.timedelta(0, cache_timeout) if not response.has_header('ETag'): response['ETag'] = md5.new(response.get_content_as_string('utf8')).hexdigest() if not response.has_header('Last-Modified'): response['Last-Modified'] = now.strftime('%a, %d %b %Y %H:%M:%S GMT') if not response.has_header('Expires'): + expires = now + datetime.timedelta(0, cache_timeout) response['Expires'] = expires.strftime('%a, %d %b %Y %H:%M:%S GMT') patch_cache_control(response, max_age=cache_timeout) |
