(caching) Set Content-Disposition header and Content-Language

This commit is contained in:
David Manouchehri 2024-01-07 12:21:15 -05:00 committed by GitHub
parent c54e0813b4
commit 56b03732ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,7 +168,9 @@ class S3Cache(BaseCache):
Body=serialized_value,
Expires=expiration_time,
CacheControl=cache_control,
ContentType="application/json"
ContentType="application/json",
ContentLanguage="en",
ContentDisposition=f"inline; filename=\"{key}.json\""
)
else:
cache_control = "immutable, max-age=31536000, s-maxage=31536000"
@ -178,7 +180,9 @@ class S3Cache(BaseCache):
Key=key,
Body=serialized_value,
CacheControl=cache_control,
ContentType="application/json"
ContentType="application/json",
ContentLanguage="en",
ContentDisposition=f"inline; filename=\"{key}.json\""
)
except Exception as e:
# NON blocking - notify users S3 is throwing an exception