From ed97ae24236cee3c5312759cb2e81fe8ee85c8f9 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 2 Aug 2017 17:12:30 +0200 Subject: [PATCH] avoid cache --- pandora/item/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/item/views.py b/pandora/item/views.py index 9999ef55..c263d95a 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -880,6 +880,7 @@ def poster(request, id, size=None): poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg') response = HttpFileResponse(poster_path, content_type='image/jpeg') response['Cache-Control'] = 'no-cache' + response['Expires'] = datetime.strftime(datetime.utcnow() - timedelta(days=1), "%a, %d-%b-%Y %H:%M:%S GMT") return response def icon(request, id, size=None): @@ -892,6 +893,7 @@ def icon(request, id, size=None): poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg') response = HttpFileResponse(poster_path, content_type='image/jpeg') response['Cache-Control'] = 'no-cache' + response['Expires'] = datetime.strftime(datetime.utcnow() - timedelta(days=1), "%a, %d-%b-%Y %H:%M:%S GMT") return response def timeline(request, id, size, position=-1, format='jpg', mode=None):