summaryrefslogtreecommitdiff
path: root/cron/handler.py
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-11-17 15:56:30 +0200
committerYuval Adam <_@yuv.al>2017-11-17 15:56:30 +0200
commit5861ad0fefe67fc5c40c46069c0aa337745eda8e (patch)
tree493fd2745abed85df06a5b9e9fb6efea60086a16 /cron/handler.py
parent1c703284cfa73350b794d50795133f2c2ea26f0b (diff)
Update MIME types and cache headers
Diffstat (limited to 'cron/handler.py')
-rw-r--r--cron/handler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cron/handler.py b/cron/handler.py
index 100041e..64f96e8 100644
--- a/cron/handler.py
+++ b/cron/handler.py
@@ -37,7 +37,7 @@ def geshem_update():
if latest_keys:
if key not in latest_keys:
- client.put_object(Bucket=BUCKET, Key=key, Body=img)
+ client.put_object(Bucket=BUCKET, Key=key, Body=img, ContentType='image/png', CacheControl='public, max-age=31536000')
latest_keys.append(key)
response += 'Put {}, '.format(key)
else:
@@ -57,7 +57,7 @@ def geshem_update():
keys = sorted(list(filter(lambda k: k.endswith('{}.png'.format(r)), latest_keys)))[-10:]
index[r] = keys
client.put_object(Bucket=BUCKET, Key='imgs.json', Body=json.dumps(index),
- ContentType='application/json', Expires=datetime.utcnow() + timedelta(minutes=1))
+ ContentType='application/json', CacheControl='public, max-age=60')
return response